Part Number Hot Search : 
S3486 IPB100N KT3153A9 MAC4M 2SK295 AD554404 LTM461 M1785
Product Description
Full Text Search
 

To Download 68HC05PD6 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  hc05pd6grs/h rev 1.1 ? motorola, inc., 1997 68HC05PD6 68hc705pd6 specification (general release) ?july 7, 1997 technical operations taiwan asia pacific semiconductor products group motorola reserves the right to make changes without further notice to any products herein to improve reliability, function or design. motorola does not assume any liability arising out of the application or use of any product or circuit described herein; neither does it convey any license under its patent rights nor the rights of others. motorola products are not designed, intended, or authorized for use as components in systems intended for surgical implant into the body, or other applications intended to support or sustain life, or for any other application in which the failure of the motorola product could create a situation where personal injury or death may occur. should buyer purchase or use motorola products for any such unintended or unauthorized application, buyer shall indemnify and hold motorola and its officers, employees, subsidiaries, affiliates, and distributors harmless against all claims, costs, damages, and expenses, and reasonable attorney fees arising out of, directly or indirectly, any claim of personal injury or death associated with such unintended or unauthorized use, even if such claim alleges that motorola was negligent regarding the design or manufacture of the part.

table of contents section title page july 7, 1997 general release specification mc68HC05PD6 motorola rev 1.1 i section 1 general description 1.1 features ...................................................................................................... 1-1 1.2 mask options.............................................................................................. 1-2 1.3 signal description .................................................................................. 1-4 1.3.1 vdd and vss .............................................................................................. 1-4 1.3.2 osc2, osc1 ............................................................................................... 1-5 1.3.3 xosc2, xosc1 .......................................................................................... 1-5 1.3.4 reset ......................................................................................................... 1-6 1.3.5 vpp.............................................................................................................. 1-6 1.3.6 pa0-pa7 ...................................................................................................... 1-6 1.3.7 pb0/kwi0 -pb7/kwi7 .................................................................................. 1-6 1.3.8 pc0/rdi, pc1/tdo ..................................................................................... 1-6 1.3.9 pc2/tcmp, pc3/tcap ............................................................................... 1-7 1.3.10 pc4/evi, pc5/evo ..................................................................................... 1-7 1.3.11 pc6/irq2 , pc7/irq1 .................................................................................. 1-7 1.3.12 bp0/pd0-bp3/pd3 ...................................................................................... 1-7 1.3.13 fp32/pd4-fp35/pd7 .................................................................................. 1-7 1.3.14 fp24/pe0-fp31/pe7................................................................................... 1-7 1.3.15 fp16/pf0-fp23/pf7 ................................................................................... 1-8 1.3.16 fp8/pg0-fp15/pg7 .................................................................................... 1-8 1.3.17 fp0/ph0-fp7/ph7 ...................................................................................... 1-8 1.3.18 vlcd3 ......................................................................................................... 1-8 1.3.19 bs1-bs3 ...................................................................................................... 1-8 1.3.20 din............................................................................................................... 1-8 section 2 memory 2.1 memory map ................................................................................................ 2-1 2.2 rom................................................................................................................. 2-2 2.3 ram ................................................................................................................. 2-2 2.4 i/o and control registers ................................................................... 2-2 section 3 central processing unit 3.1 registers .................................................................................................... 3-1 3.2 accumulator (a)........................................................................................ 3-2 3.3 index register (x) ..................................................................................... 3-2 3.4 stack pointer (sp) .................................................................................... 3-2 3.5 program counter (pc) ........................................................................... 3-3 3.6 condition code register (ccr) ........................................................... 3-3 3.6.1 half carry bit (h-bit) .................................................................................... 3-3 3.6.2 interrupt mask (i-bit) .................................................................................... 3-3
general release specification july 7, 1997 motorola mc68HC05PD6 ii rev 1.1 table of contents section title page 3.6.3 negative bit (n-bit) ...................................................................................... 3-3 3.6.4 zero bit (z-bit) ............................................................................................. 3-4 3.6.5 carry/borrow bit (c-bit) ............................................................................... 3-4 section 4 interrupts 4.1 cpu interrupt processing ................................................................... 4-1 4.2 reset interrupt sequence .................................................................. 4-3 4.3 software interrupt (swi) ..................................................................... 4-3 4.4 hardware interrupts ............................................................................ 4-4 4.4.1 p-decoder interrupt (pdi)............................................................................ 4-4 4.4.2 irq1 and irq2 ............................................................................................ 4-4 4.4.3 key wake-up interrupt (kwi )....................................................................... 4-6 4.4.4 timer interrupt ............................................................................................. 4-7 4.4.5 serial communication interface (sci) ......................................................... 4-7 4.4.6 real time clock interrupt (rtc) ................................................................. 4-7 4.4.7 interrupt control register (intcr) .............................................................. 4-7 4.4.8 interrupt status register (intsr)................................................................ 4-8 4.4.9 key wake-up input enable register (kwien)............................................ 4-9 section 5 resets 5.1 external reset (reset).......................................................................... 5-1 5.2 internal resets ........................................................................................ 5-2 5.2.1 power-on reset (por) ............................................................................... 5-2 5.2.2 computer operating properly reset (copr).............................................. 5-2 5.2.3 illegal address reset (iladr)..................................................................... 5-2 section 6 low power modes 6.1 single-chip (normal) mode.................................................................... 6-1 6.2 self-check mode....................................................................................... 6-1 6.3 low-power modes .................................................................................... 6-1 6.3.1 stop instruction ......................................................................................... 6-2 6.3.2 wait instruction .......................................................................................... 6-2 section 7 input/output ports 7.1 port a............................................................................................................ 7-1 7.2 port b............................................................................................................ 7-1 7.3 port c............................................................................................................ 7-2 7.4 port d............................................................................................................ 7-3 7.4.1 port d mux register (pdmux)................................................................... 7-4
table of contents section title page july 7, 1997 general release specification mc68HC05PD6 motorola rev 1.1 iii 7.5 port e............................................................................................................ 7-4 7.5.1 port e mux register (pemux) ................................................................... 7-5 7.6 port f, port g and port h ..................................................................... 7-5 7.6.1 port f mux register (pfmux).................................................................... 7-5 7.6.2 port g mux register (pgmux) .................................................................. 7-6 7.6.3 port h mux register (phmux)................................................................... 7-6 7.7 input/ouput programming.................................................................... 7-6 7.8 port option control registers ........................................................ 7-7 7.8.1 resistor control register 1 (rcr1) ............................................................ 7-7 7.8.2 resistor control register 2 (rcr2) ............................................................ 7-8 7.8.3 open drain output control register 1 (wom1) .......................................... 7-8 7.8.4 open drain output control register 2 (wom2) .......................................... 7-9 section 8 clock distribution 8.1 osc clock divider and por counter ................................................ 8-1 8.2 system clock control .......................................................................... 8-2 8.3 osc and xosc.............................................................................................. 8-2 8.3.1 osc on line ............................................................................................... 8-2 8.3.2 xosc on line ............................................................................................. 8-3 8.4 time base ...................................................................................................... 8-4 8.4.1 lcdclk....................................................................................................... 8-5 8.4.2 stup ........................................................................................................... 8-5 8.4.3 watchdog timer (cop) ............................................................................... 8-5 8.4.4 time base control register 1 (tbcr1) ...................................................... 8-6 8.4.5 time base control register 2 (tbcr2) ...................................................... 8-7 8.5 real time clock (rtc) .............................................................................. 8-7 8.5.1 rtc time registers .................................................................................... 8-7 8.5.2 rtc alarm registers................................................................................... 8-9 8.5.3 rtc status register.................................................................................... 8-9 8.5.4 rtc control register ................................................................................ 8-10 8.6 miscellaneous register (misc)......................................................... 8-11 section 9 timer system 9.1 timer1 ............................................................................................................ 9-1 9.1.1 counter ........................................................................................................ 9-2 9.1.2 output compare register............................................................................ 9-6 9.1.3 input capture register................................................................................. 9-8 9.1.4 timer control register (tcr).................................................................... 9-10 9.1.5 timer status register (tsr) ..................................................................... 9-11 9.1.6 operation during low power mode........................................................... 9-12 9.2 timer 2 ......................................................................................................... 9-12
general release specification july 7, 1997 motorola mc68HC05PD6 iv rev 1.1 table of contents section title page 9.2.1 timer control register 2 (tcr2)............................................................... 9-16 9.2.2 timer status register 2 (tsr2) ................................................................ 9-17 9.2.3 output compare register 2 (oc2) ............................................................ 9-18 9.2.4 timer counter 2 (cnt2) ............................................................................ 9-18 9.2.5 time base control register 1 (tbcr1) .................................................... 9-18 9.2.6 timer input 2 (evi) .................................................................................... 9-19 9.2.7 event output (evo)................................................................................... 9-21 9.3 prescaler ................................................................................................. 9-23 section 10 lcd driver 10.1 lcd waveform examples ..................................................................... 10-1 10.2 vlcd3 bias input & bias resistors .................................................... 10-4 10.3 backplane driver and port selection .......................................... 10-5 10.4 lcd control register (lcdcr) .......................................................... 10-5 10.5 lcd data register (lcdrx) ................................................................... 10-6 section 11 serial communications interface 11.1 sci two-wire system features ......................................................... 11-1 11.2 sci receiver features.......................................................................... 11-1 11.3 sci transmitter features .................................................................. 11-1 11.4 data format ............................................................................................. 11-3 11.5 wake-up feature..................................................................................... 11-3 11.6 receive data in (rdi)............................................................................... 11-4 11.7 start bit detection following a framing error ..................... 11-4 11.8 transmit data out (tdo)....................................................................... 11-6 11.9 sci registers ........................................................................................... 11-6 11.9.1 serial communications data register (scdat) ....................................... 11-6 11.9.2 serial communications control register 1 (sccr1) ................................ 11-7 11.9.3 serial communications control register 2 (sccr2) ................................ 11-8 11.9.4 serial communications status register (scsr)..................................... 11-10 11.9.5 baud rate register ................................................................................. 11-12 section 12 p-decoder 12.1 p-decoder features ............................................................................. 12-1 12.2 ccir radiopaging code no.1 ....................................................................... 12-1 12.2.1 preamble ................................................................................................... 12-1 12.2.2 batch structure .......................................................................................... 12-2 12.2.3 codeword .................................................................................................. 12-3 12.3 functional blocks................................................................................. 12-3 12.3.1 clock generator......................................................................................... 12-5
table of contents section title page july 7, 1997 general release specification mc68HC05PD6 motorola rev 1.1 v 12.3.2 bch corrector ........................................................................................... 12-5 12.3.3 address comparator.................................................................................. 12-6 12.3.4 battery saving generator .......................................................................... 12-6 12.3.5 mode generator......................................................................................... 12-7 12.3.6 programming mode ................................................................................... 12-7 12.3.7 waiting mode............................................................................................. 12-7 12.3.8 frame state generator.............................................................................. 12-9 12.3.9 preamble and synchronization codeword detector.................................. 12-9 12.4 registers ................................................................................................ 12-10 12.4.1 p-decoder control register 1 (pdcr1) .................................................. 12-10 12.4.2 p-decoder control register 2 (pdcr2) .................................................. 12-11 12.4.3 p-decoder control register 3 (pdcr3)................................................... 12-11 12.4.4 p-decoder status register (pdsr)......................................................... 12-12 12.4.5 user address registers........................................................................... 12-13 12.4.6 received address information register (rair) ...................................... 12-15 12.4.7 received message information registers (rmirx)................................. 12-15 section 13 instruction set 13.1 addressing modes ................................................................................. 13-1 13.1.1 inherent...................................................................................................... 13-1 13.1.2 immediate .................................................................................................. 13-1 13.1.3 direct ......................................................................................................... 13-2 13.1.4 extended.................................................................................................... 13-2 13.1.5 indexed, no offset..................................................................................... 13-2 13.1.6 indexed, 8-bit offset .................................................................................. 13-2 13.1.7 indexed, 16-bit offset ................................................................................ 13-3 13.1.8 relative...................................................................................................... 13-3 13.1.9 instruction types ....................................................................................... 13-3 13.1.10 register/memory instructions .................................................................... 13-4 13.1.11 read-modify-write instructions ................................................................. 13-5 13.1.12 jump/branch instructions .......................................................................... 13-5 13.1.13 bit manipulation instructions...................................................................... 13-7 13.1.14 control instructions.................................................................................... 13-7 13.1.15 instruction set summary ........................................................................... 13-8 section 14 electrical specifications 14.1 maximum ratings..................................................................................... 14-1 14.2 thermal characteristics ................................................................... 14-1 14.3 dc electrical characteristics........................................................ 14-2 14.4 control timing ........................................................................................ 14-4 section 15
general release specification july 7, 1997 motorola mc68HC05PD6 vi rev 1.1 table of contents section title page mechanical specifications 15.1 80-pin thin-quad-flat-package (case 917-01) .................................. 15-2 15.2 80-pin quad-flat-package (case 841b-01).......................................... 15-3 appendix a mc68hc705pd6 a.1 introduction..............................................................................................a-1 a.2 memory .........................................................................................................a-1 a.3 mask option register (mosr), $000f ..................................................a-1 a.4 bootloader mode ....................................................................................a-2 a.5 eprom programming ...............................................................................a-3 a.5.1 eprom program control register (pcr)...................................................a-3 a.5.2 programming sequence ..............................................................................a-4 a.6 eprom programming specifications ................................................a-4
list of figures figure title page july 7, 1997 general release specification mc68HC05PD6 motorola rev 1.1 vii 1-1 mc68HC05PD6 block diagram ....................................................................... 1-3 1-2 80-pin tqfp pin assignment .......................................................................... 1-4 1-3 osc connections ............................................................................................ 1-5 1-4 xosc connections .......................................................................................... 1-6 2-1 mc68HC05PD6 memory map ......................................................................... 2-1 2-2 mc68HC05PD6 main i/o register $00-$0f (optm = 0) ................................ 2-3 2-3 mc68HC05PD6 main i/o register $10-$1f (optm =0) ................................. 2-4 2-4 mc68HC05PD6 main i/o register $20-$2f (optm = 0) ................................ 2-5 2-5 mc68HC05PD6 main i/o register $30-$3f (optm = 0) ................................ 2-6 2-6 mc68HC05PD6 option i/o register $00-$0f (optm = 1) ............................. 2-7 2-7 mc68HC05PD6 option i/o register $10-$1f (optm = 1) ............................. 2-8 2-8 mc68HC05PD6 option i/o register $20-$2f (optm = 1) ............................. 2-9 2-9 mc68HC05PD6 option i/o register $30-$3f (optm = 1) ........................... 2-10 3-1 mc68hc05 programming model ..................................................................... 3-1 4-1 interrupt processing flowchart ........................................................................ 4-3 4-2 external interrupt.............................................................................................. 4-5 4-3 key wake-up interrupt (kwi) ........................................................................... 4-6 5-1 reset block diagram ....................................................................................... 5-1 6-1 clock state and stop recovery/por delay diagrams ................................. 6-3 6-2 stop/wait flowcharts ................................................................................... 6-4 7-1 port i/o circuitry............................................................................................... 7-7 8-1 clock signal distribution .................................................................................. 8-1 8-2 time base clock divider.................................................................................. 8-5 8-3 rtc holding register ...................................................................................... 8-8 9-1 timer system block diagram........................................................................... 9-1 9-2 timer 1 block diagram..................................................................................... 9-3 9-3 timer state timing diagram for reset............................................................. 9-4 9-4 timer state timing diagram for timer overflow.............................................. 9-4 9-5 timer state timing diagram for output compare .......................................... 9-7 9-6 timer state timing diagram for input capture ............................................... 9-9 9-7 timer 2 block diagram................................................................................... 9-13 9-8 timer 2 timing diagram for f(ph2) > f(timclk) ........................................... 9-14 9-9 timer 2 timing diagram for f(ph2) = f(timclk) ........................................... 9-15 9-10 evi block diagram ......................................................................................... 9-19 9-11 evi timing diagram ....................................................................................... 9-21 9-12 evo block diagram ....................................................................................... 9-22 9-13 evo timing diagram ..................................................................................... 9-23 9-14 prescaler block diagram................................................................................ 9-24 10-1 lcd 1/3 duty and 1/3 bias timing diagram .................................................. 10-2 10-2 lcd 1/4 duty and 1/4 bias timing diagram .................................................. 10-3 10-3 simplified lcd voltage divider schematic .................................................... 10-4 11-1 serial communications interface block diagram........................................... 11-2 11-2 data format ................................................................................................... 11-3
general release specification july 7, 1997 motorola mc68HC05PD6 viii rev 1.1 list of figures figure title page 11-3 sampling technique used on all bits ............................................................. 11-4 11-4 example of start-bit sampling technique ..................................................... 11-5 11-5 sci artificial start following a framing error.................................................. 11-5 11-6 sci start following a break ............................................................................ 11-5 11-7 rate generator division............................................................................... 11-13 12-1 ccir radiopaging code no.1 format........................................................... 12-2 12-2 p-decoder block diagram.............................................................................. 12-4 12-3 bch decoder flow chart............................................................................... 12-5 12-4 mode transition diagram............................................................................... 12-7 12-5 battery saving signals in waiting mode ........................................................ 12-8 12-6 p-decoder flags timing .............................................................................. 12-17 12-7 receiving mode timing................................................................................ 12-18 15-1 80-pin tqfp mechanical dimensions ........................................................... 15-2 15-2 80-pin qfp mechanical dimensions ............................................................. 15-3 a-1 mc68hc705pd6 memory map .......................................................................a-2 a-2 eprom programming sequence ....................................................................a-5
list of tables table title page july 7, 1997 general release specification mc68HC05PD6 motorola rev 1.1 ix 4-1 vector address for interrupts and reset.......................................................... 4-2 6-1 operating mode initialization............................................................................ 6-1 7-1 i/o pin functions.............................................................................................. 7-7 8-1 system clock frequencies .............................................................................. 8-2 8-2 recovery time requirements.......................................................................... 8-4 8-3 cop time out period ...................................................................................... 8-6 9-1 evi mode select ............................................................................................ 9-20 9-2 clk2 divide ratio.......................................................................................... 9-24 10-1 backplanes and port selection ...................................................................... 10-5 10-2 lcd bias resistors ........................................................................................ 10-6 11-1 prescaler highest baud rate frequency output ......................................... 11-13 11-2 transmit baud rate output for a given prescaler output.......................... 11-14 12-1 timing of battery saving signals .................................................................. 12-8 12-2 frame number definition ............................................................................. 12-11 13-1 register/memory instructions ........................................................................ 13-4 13-2 read-modify-write instructions...................................................................... 13-5 13-3 jump and branch instructions........................................................................ 13-6 13-4 bit manipulation instructions .......................................................................... 13-7 13-5 control instructions ........................................................................................ 13-7 13-6 instruction set summary............................................................................... 13-8 13-7 opcode map................................................................................................. 13-14 14-1 maximum ratings .......................................................................................... 14-1 14-2 thermal characteristics ................................................................................. 14-1 14-3 dc electrical characteristics (5v).................................................................. 14-2 14-4 dc electrical characteristics (3.6v)............................................................... 14-3 14-5 control timing (5v) ........................................................................................ 14-4 14-6 control timing (3.6v) ..................................................................................... 14-5 a-1 operating mode initialization............................................................................a-3 a-2 eprom programming electrical characteristics .............................................a-4
general release specification july 7, 1997 motorola mc68HC05PD6 x rev 1.1 list of tables table title page
july 7, 1997 general release specification mc68HC05PD6 general description motorola rev 1.1 1-1 section 1 general description the mc68HC05PD6 is a member of the mc68hc05 family of hcmos microcontroller units (mcus). this sophisticated 80-pin mcu has 16k-bytes of user rom, 512 bytes of ram, and eight parallel ports. ports a, b, c, f, g, and h have eight i/o pins, port d and e have 8 output-only pins. the mc68HC05PD6 includes a time base circuit, 8 and 16-bit timers, a cop watchdog timer, lcd drivers, serial communication interface and p-decoder. it is targeted for communication applications such as pagers. 1.1 features industry standard m68hc05 8-bit cpu core 16400 bytes of user rom 512 bytes of user ram (64 bytes for stack) 48 bidirectional i/o lines 16 output-only lines 16-bit timer with input capture and output compare functions cop watchdog timer serial communication interface (sci) lcd drivers (3 or 4 backplane drivers) x (1 to 36 frontplane drivers) on-chip time base circuits dual oscillators (76.8khz and 4mhz) and selectable system clock frequency 24-hour real time clock 8-bit event counter / modulus clock divider key wake-up interrupt with 8-bit input p-decoder two irq inputs available in 80-pin tqfp package
general release specification july 7, 1997 motorola general description mc68HC05PD6 1-2 rev 1.1 note a line over a signal name indicates an active low signal. any reference to voltage, current, or frequency speci?d in the following sections will refer to the nominal values. the exact values and their tolerance or limits are speci?d in section 14 . 1.2 mask options the following mask options are available: reset pin pull-up resistor: [connected or disconnected osc feedback resistor (between osc1 and osc2): [connected or disconnected] xosc feedback resistor (between xosc1 and xosc2): [connected or disconnected]
july 7, 1997 general release specification mc68HC05PD6 general description motorola rev 1.1 1-3 figure 1-1. mc68HC05PD6 block diagram pb0/kwi0 pb1/kwi1 pb2/kwi2 pb3/kwi3 pb4/kwi4 pb5/kwi5 osc kwi port b reg 512 bytes ram 16k bytes rom pa0 pa1 pa2 pa3 pa4 pa5 pa6 pa7 port a reg pc0/rdi pc1/tdo pc2/tcmp pc3/tcap pc4/evi pc5/evo pc6*/irq2 port c reg stk ptr cond code reg 1 1 1 i n z c h index reg cpu control 0 0 0 1 1 0 0 0 0 0 alu 68hc05 cpu accum program counter cpu registers sci pb6/kwi6 pb7/kwi7 rdi tdo timer1 tcap tcmp timer2 evi evo int irq2 irq1 time base port d reg port e reg bp0/pd0 bp1/pd1 bp2/pd2 bp3/pd3 fp32/pd4 fp33/pd5 fp34/pd6 fp35/pd7 fp31/pe7 fp30/pe6 fp29/pe5 fp28/pe4 fp27/pe3 fp26/pe2 fp25/pe1 fp24/pe0 xosc reset power lcd driver p-decoder bs1 bs3 bs2 din osc1 osc2 xosc1 xosc2 reset vss vdd vdd vpp vdd cop vss port f reg fp23/pf7 fp22/pf6 fp21/pf5 fp20/pf4 fp19/pf3 fp18/pf2 fp17/pf1 fp16/pf0 port g reg fp15/pg7 fp14/pg6 fp13/pg5 fp12/pg4 fp11/pg3 fp10/pg2 fp9/pg1 fp8/pg0 port h reg fp7/ph7 fp6/ph6 fp5/ph5 fp4/ph4 fp3/ph3 fp2/ph2 fp1/ph1 fp0/ph0 rtc vlcd3 pc7*/irq1 * open drain output
general release specification july 7, 1997 motorola general description mc68HC05PD6 1-4 rev 1.1 figure 1-2. 80-pin tqfp pin assignment 1.3 signal description 1.3.1 vdd and vss power is supplied to the microcontroller using these pins. vdd is the positive supply and vss is ground pin. there are two pairs of power pins to improve noise immunity inside the chip. 1 20 40 41 60 61 80 21 vdd fp28/pe4 fp29/pe5 fp30/pe6 fp31/pe7 fp32/pd4 fp33/pd5 fp34/pd6 fp35/pd7 vlcd3 vdd bs3 bs2 bs1 din vss vpp xosc1 xosc2 reset vss fp7/ph7 fp6/ph6 fp5/ph5 fp4/ph4 fp3ph3 fp2/ph2 fp1/ph1 fp0/ph0 bp0/pd0 bp1/pd1 bp2/pd2 bp3/pd3 vdd pc7/irq1 pc6/irq2 pc5/evo pc4/evi pc3/tcap pc2/tcmp osc1 osc2 pa0 pa1 pa2 pa3 pa4 pa5 pa6 pa7 pb0/kwi0 pb1/kwi1 pb2/kwi2 pb3/kwi3 pb4/kwi4 pb5/kwi5 pb6/kwi6 pb7/kwi7 pc0/rdi pc1/tdo fp27/pe3 fp26/pe2 fp25/pe1 fp24/pe0 fp23/pf7 fp22/pf6 fp21/pf5 fp20/pf4 fp19/pf3 fp18/pf2 fp17pf1 fp16/pf0 fp15/pg7 fp14/pg6 fp13/pg5 fp12/pg4 fp11/pg3 fp10/pg2 fp9/pg1 fp8/pg0
july 7, 1997 general release specification mc68HC05PD6 general description motorola rev 1.1 1-5 1.3.2 osc2, osc1 these pins provide an on-chip clock oscillator circuit. a crystal, a ceramic resonator, or an external signal connects to these pins providing a system clock. the oscillator frequency divided by 2, 4, and 64 are available for the system clock. an external clock signal source should be connected to osc1 while leaving osc2 pin unconnected. 4 mhz is recommended at vdd=+5v. 1.3.3 xosc2, xosc1 xosc has the same structure as osc. it is the secondary oscillator run after power-up and can be selected as system clock instead of osc. it also provides the clock source for p-decoder. a 76.8khz crystal is recommended. the osc1/xosc1 and osc2/xosc2 pins are the connections for the on-chip oscillator. the pins can accept the following sets of components: 1. a crystal as shown in figure 1-3(a) and figure 1-3(a) 2. an external clock signal as shown in figure 1-4(b) and figure 1-4(b) the circuits show in figure 1-3(a) and figure 1-4(a) are typical oscillator circuit for an at-cut, parallel resonant crystal. the crystal manufacturers recommendations should be followed, as the crystal parameters determine the external component values required to provide maximum stability and reliable start-up. the load capacitance values used in the oscillator circuit design should include all stray capacitances. the crystal and components should be mounted as close as possible to the pins for start-up stabilization and to minimize output distortion. osc and xosc pins have mask options for feedback and damping resistor implementations. see section 1.2 for these mask options and section 14 for the resistor values. figure 1-3. osc connections r f r f osc1 osc2 mcu osc1 osc2 mcu mask option mask option unconnected external clock (b) external clock source connection (a) crystal or ceramic resonator connections
general release specification july 7, 1997 motorola general description mc68HC05PD6 1-6 rev 1.1 figure 1-4. xosc connections 1.3.4 r eset this active low input-only pin is used to reset the mcu to a known start-up state. the reset pin contains an internal schmitt trigger as part of its input to improve noise immunity. see section 5 for more details. 1.3.5 vpp this pin is used to supply high voltage needed for programming the user eprom on the mc68hc705pd6 device. in normal operation, this pin should be connected to vdd. 1.3.6 pa0-pa7 these eight i/o lines comprise port a. the state of any pin is software programmable and all port a lines are con?ured as inputs during reset. see section 7 for a detailed description of i/o programming. 1.3.7 pb0/kwi0 -pb7/kwi7 these eight pins are either general purpose i/o pins port b or key wake-up interrupt input. see section 7 for a detailed description of i/o programming and section 4 for a detailed description of interrupts. 1.3.8 pc0/rdi, pc1/tdo these two pins are either general purpose i/o pins port c or the receive data r f r d xosc1 xosc2 mcu mask option on chip off chip r f r d xosc1 xosc2 mcu mask option unconnected external clock (b) external clock source connection (a) crystal or ceramic resonator connections
july 7, 1997 general release specification mc68HC05PD6 general description motorola rev 1.1 1-7 input, rdi, and transmit data output, tdo, of serial communication interface. see section 7 for a detailed description of i/o programming and section 11 for a detailed description of sci. 1.3.9 pc2/tcmp, pc3/tcap these two pins are either the input capture, tcap and output compare pins, tcmp, of timer1 or general purpose i/o port c. see section 7 for a detailed description of i/o programming and section 9 for a detailed description of the timer system. 1.3.10 pc4/evi, pc5/evo these two pins are either the event counter input, evi and output, evo of timer2 or general purpose i/o port c. see section 7 for a detailed description of i/o programming and section 9 for a detailed description of the timer system. 1.3.11 pc6/irq2 , pc7/irq1 these two pins are either the external interrupts input or general purpose i/o port c. the external interrupts input are software programmable for two different choices of interrupt triggering sensitivity. these options are: 1) negative edge- sensitive triggering only, or 2) both negative edge-sensitive and level-sensitive triggering. in the latter case, either type of input to the irq1 or irq2 pin will produce the interrupt. see section 7 for a detailed description of i/o programming and section 4 for a detailed description of interrupts. 1.3.12 bp0/pd0-bp3/pd3 these four pins are either general purpose output pins port d or backplane outputs (bp0-bp3) of lcd driver. see section 7 for a detailed description of i/o programming and section 10 for a detail description of lcd drivers. 1.3.13 fp32/pd4-fp35/pd7 these four pins are either general purpose output pins port d or frontplane outputs (fp32-fp35) of lcd driver. 1.3.14 fp24/pe0-fp31/pe7 these eight pins are either general purpose output pins port e or frontplane outputs (fp24-fp31) of lcd driver.
general release specification july 7, 1997 motorola general description mc68HC05PD6 1-8 rev 1.1 1.3.15 fp16/pf0-fp23/pf7 these eight pins are either general purpose i/o pins port f or frontplane outputs (fp23-fp16) of lcd driver. 1.3.16 fp8/pg0-fp15/pg7 these eight pins are either general purpose i/o pins port g or frontplane outputs (fp8-fp15) of lcd driver. 1.3.17 fp0/ph0-fp7/ph7 these eight pins are either general purpose i/o pins port h or frontplane outputs (fp0-fp7) of lcd driver. 1.3.18 vlcd3 vlcd3 provides the voltage reference for the lcd driver circuitry. see section 10 for a detail description of lcd driver. 1.3.19 bs1-bs3 these are the power saving pins output from p-decoder. 1.3.20 din this is the ccir radiopaging code no.1 data input pin.
july 7, 1997 general release specification mc68HC05PD6 memory motorola rev 1.1 2-1 section 2 memory the mc68HC05PD6 has 64k-bytes of addressable memory, consisting of 64 bytes of i/o, 512 bytes of user ram, and 16384 bytes of user rom, as shown in figure 2-1 . 2.1 memory map the mc68HC05PD6 memory map is shown in figure 2-1 . figure 2-1. mc68HC05PD6 memory map $0000 $003f 0000 0063 i/o registers i/o 64 bytes $0000 $003f $0040 $00c0 $00ff $023f $0240 $0fff $1000 $4fff $5000 $fdff $fe00 $ffdf $ffe0 $ffef $fff0 $ffff ram stack 64 bytes 512 bytes unused user rom unused self-check rom test vectors user vectors dual mapped 64 bytes 0 63 64 191 192 255 256 575 576 4095 4096 20479 20480 65023 65024 65503 65504 65519 65520 65535 16k bytes
general release specification july 7, 1997 motorola memory mc68HC05PD6 2-2 rev 1.1 2.2 rom the user rom consists of 16k bytes of rom from $1000 through $4fff and 16 bytes of user vectors from $fff0 through $ffff. the self-check rom is located from $fe00 through $ffdf and self-check vectors are located from $ffe0 through $ffef. 2.3 ram the user ram consists of 512 bytes from $0040 to $023f. the stack pointer can access 64 bytes of ram from $00ff to $00c0. using the stack area for data stor- age or temporary work locations requires care to prevent it from being overwritten due to stacking from an interrupt or subroutine call. 2.4 i/o and control registers there are two i/o memory map ?main i/o map and option i/o map. the main i/o map is located at $0000-$003f and is accessible when optm bit in the misc reg- ister ($003e) is clear. the option map is located at $0000-$003f and is accessi- ble when optm bit in the misc register ($003e) is set. figure 2-2 to figure 2-9 show the two i/o mappings.
july 7, 1997 general release specification mc68HC05PD6 memory motorola rev 1.1 2-3 figure 2-2. mc68HC05PD6 main i/o register $00-$0f (optm = 0) serial com control reg 1 sccr1 port d data portd w r pc6 $0003 $0002 port c data portc w r scd0 read write $0000 port a data porta w r pa0 pa1 pa2 pa3 pa4 pa5 pa6 pa7 $0001 port b data portb w r $0004 port e data porte w r pe0 pe1 pe2 pe3 pe4 pe5 pe6 pe7 $0009 addr 1 0 2 3 4 5 6 7 register $000c w r unimplemented $0005 port f data portf w r $0006 port g data portg w r $0007 $000a serial com data reg scdat $000b key int enable reg kwien $000d w r $000e $000f pb0 pb1 scd3 scd5 scd2 scd6 pb2 pb3 pb4 pb5 pc0 pc1 pc2 pc3 pc4 pc5 pc7 pf0 pf1 pf2 pf3 pf4 pf5 pg0 pg1 pg2 pg3 pg4 pg5 pg6 pg7 scd7 scd4 scd1 serial com control reg 2 sccr2 port h data porth w r pf6 pf7 pd0 pd1 baud rate reg brr r scr0 scr1 scr2 0 scp0 scp1 0 0 w r r8 t8 m wake w r re te tie tcie rie rwu wbk ilie w r fe serial com status reg scsr $0008 interrupt control reg intcr w r irq1e irq2e 0 kwie irq1s 0 0 rirq2 rirq1 rkwif 0 interrupt status reg intsr w r irq2f irq1f kwif 0 reserved nf or w tc tdre rdrf idle pd2 pd3 pd4 pd5 pd6 pd7 pb6 pb7 ph0 ph1 ph2 ph3 ph4 ph5 ph6 ph7 irq2s kwie0 kwie1 kwie2 kwie3 kwie4 kwie5 kwie6 kwie7 0 0 0
general release specification july 7, 1997 motorola memory mc68HC05PD6 2-4 rev 1.1 figure 2-3. mc68HC05PD6 main i/o register $10-$1f (optm =0) 0 timer counter reg 2 cnt2 timer control reg 2 tcr2 output compare reg h oc1h read write $0010 $0011 $0014 $0019 w r addr 1 0 2 3 4 5 6 7 register $001c unimplemented $0012 $0013 $0015 timer status reg tsr $0016 input capture reg h icaph w r $0017 input capture reg l icapl w r $0018 w r $001a $001b $001d $001e w r $001f 0 0 0 0 tof icf oc1f timer status reg 2 tsr2 w r output compare reg 2 oc2 w r w r 0 0 t2r0 t2r1 w r w r time base control reg 1 tbcr1 time base control reg 2 tbcr2 0 tbclk 0 lclk olvl timer control reg tcr w r oe1 iedg 0 0 toie oc1ie reserved counter alternate reg l acntl counter alternate reg h acnth w r w r counter reg l cntl w r counter reg h cnth w r 1oc7 output compare reg l oc1l w r 1oc1 1oc5 1oc4 1oc3 1oc2 1oc6 icie ic8 ic9 ic10 ic11 ic12 ic13 ic14 ic15 ic0 ic1 ic2 ic3 ic4 ic5 ic6 ic7 1oc8 1oc9 1oc10 1oc11 1oc12 1oc13 1oc14 1oc15 1oc0 cnt8 cnt9 cnt10 cnt11 cnt12 cnt13 cnt14 cnt15 cnt0 cnt1 cnt2 cnt3 cnt4 cnt5 cnt6 cnt7 acnt8 acnt9 acnt10 acnt11 acnt12 acnt13 acnt14 acnt15 acnt0 acnt1 acnt2 acnt3 acnt4 acnt5 acnt6 acnt7 ol2 oe2 il2 im2 t2clk 0 oc2ie ti2ie 0 0 roc2f rti2f 0 0 oc2f ti2f 2oc7 2oc1 2oc5 2oc4 2oc3 2oc2 2oc6 2oc0 2cnt0 2cnt1 2cnt2 2cnt3 2cnt4 2cnt5 2cnt6 2cnt7 timer reset to $01 0 cope 0 0 rtr0 rtr1 0 0
july 7, 1997 general release specification mc68HC05PD6 memory motorola rev 1.1 2-5 figure 2-4. mc68HC05PD6 main i/o register $20-$2f (optm = 0) read write addr 1 0 2 3 4 5 6 7 register unimplemented $002f lcd register 15 lcdr15 w r $002e lcd register 14 lcdr14 w r $002d lcd register 13 lcdr13 w r $002c lcd register 12 lcdr12 w r $002a lcd register 10 lcdr10 w r $0029 lcd register 9 lcdr9 w r $002b lcd register 11 lcdr11 w r $0028 lcd register 8 lcdr8 w r $0027 lcd register 7 lcdr7 w r $0026 lcd register 6 lcdr6 w r $0025 lcd register 5 lcdr5 w r $0023 lcd register 3 lcdr3 w r $0022 lcd register 2 lcdr2 w r $0024 lcd register 4 lcdr4 w r $0021 lcd register 1 lcdr1 w r f0b0 f0b1 f0b2 f0b3 f1b0 f1b1 f1b2 f1b3 $0020 lcd control reg lcdcr w r lc fc 0 0 dutyof dutys 0 lcde reserved f2b0 f2b1 f2b2 f2b3 f3b0 f3b1 f3b2 f3b3 f4b0 f4b1 f4b2 f4b3 f5b0 f5b1 f5b2 f5b3 f6b0 f6b1 f6b2 f6b3 f7b0 f7b1 f7b2 f7b3 f8b0 f8b1 f8b2 f8b3 f9b0 f9b1 f9b2 f9b3 f10b0 f10b1 f10b2 f10b3 f11b0 f11b1 f11b2 f11b3 f12b0 f12b1 f12b2 f12b3 f13b0 f13b1 f13b2 f13b3 f14b0 f14b1 f14b2 f14b3 f15b0 f15b1 f15b2 f15b3 f16b0 f16b1 f16b2 f16b3 f17b0 f17b1 f17b2 f17b3 f18b0 f18b1 f18b2 f18b3 f19b0 f19b1 f19b2 f19b3 f20b0 f20b1 f20b2 f20b3 f21b0 f21b1 f21b2 f21b3 f22b0 f22b1 f22b2 f22b3 f23b0 f23b1 f23b2 f23b3 f24b0 f24b1 f24b2 f24b3 f25b0 f25b1 f25b2 f25b3 f26b0 f26b1 f26b2 f26b3 f27b0 f27b1 f27b2 f27b3 f28b0 f28b1 f28b2 f28b3 f29b0 f29b1 f29b2 f29b3
general release specification july 7, 1997 motorola memory mc68HC05PD6 2-6 rev 1.1 figure 2-5. mc68HC05PD6 main i/o register $30-$3f (optm = 0) read write addr 1 0 2 3 4 5 6 7 register unimplemented $003f test reg test w r $003e miscelleous reg misc w r $003d eprom control reg pcr w r $003c unimplemented w r $003a rtc control reg rtcc w r $0039 rtc status reg rtcs w r $003b unimplemented w r $0038 rtc second alarm reg seca w r $0037 rtc minute alarm reg mina w r $0036 rtc hour alarm reg houra w r $0035 rtc second reg sec w r $0033 rtc hour reg hour w r $0032 lcd register 18 lcdr18 w r $0034 rtc minute reg min w r $0031 lcd register 17 lcdr17 w r f32b0 f32b1 f32b2 f32b3 f33b0 f33b1 f33b2 f33b3 $0030 lcd register 16 lcdr16 w r reserved f34b0 f34b1 f34b2 f34b3 f35b0 f35b1 f35b2 f35b3 hour0 hour1 hour2 hour3 hour4 0 0 0 min0 min1 min2 min3 min4 min4 0 0 sec0 sec1 sec2 sec3 sec4 sec5 0 0 rtcf alf secf 0 0 0 0 0 rtce ale sece 0 0 0 0 0 optm fosce sys0 sys1 0 0 stup ftup f30b0 f30b1 f30b2 f30b3 f31b0 f31b1 f31b2 f31b3 houra0 houra1 houra2 houra3 houra4 0 0 0 mina0 mina1 mina2 mina3 mina4 mina5 0 0 seca0 seca1 seca2 seca3 seca4 seca5 0 0
july 7, 1997 general release specification mc68HC05PD6 memory motorola rev 1.1 2-7 figure 2-6. mc68HC05PD6 option i/o register $00-$0f (optm = 1) read write addr 1 0 2 3 4 5 6 7 register unimplemented $000f mask option status reg mosr w r $000e port h mux register phmux w r $000d port g mux register pgmux w r $000c port f mux register pfmux w r $000a open drain control reg wom1 w r $0009 resistor control reg 2 rcr2 w r $000b open drain control reg wom2 w r $0008 resistor control reg 1 rcr1 w r $0007 port h data direction reg ddrh w r $0006 port g data direction reg ddrg w r $0005 port f data direction reg ddrf w r $0003 port d mux register pdmux w r $0002 port c data direction reg ddrc w r $0004 port e mux register pemux w r $0001 port b data direction reg ddrb w r ddrb0 ddrb1 ddrb2 ddrb3 ddrb4 ddrb5 ddrb6 ddrb7 $0000 port a data direction reg ddra w r ddra0 ddra1 ddra2 ddra3 ddra4 ddra5 ddra6 ddra7 reserved ddrc0 ddrc1 ddrc2 ddrc3 ddrc4 ddrc5 ddrc6 ddrc7 0 0 0 0 pdm4 pdm5 pdm6 pdm7 pem0 pem1 pem2 pem3 pem4 pem5 pem6 pem7 ral rah rbl rbh 0 0 0 0 rc0 rc1 rc2 rc3 rc4 rc5 rc6 rc7 awoml awomh 0 0 ewoml ewomh dwoml dwomh 0 0 0 0 0 xoscr oscr rstr ddrf0 ddrf1 ddrf2 ddrf3 ddrf4 ddrf5 ddrf6 ddrf7 ddrg0 ddrg1 ddrg2 ddrg3 ddrg4 ddrg5 ddrg6 ddrg7 ddrh0 ddrh1 ddrh2 ddrh3 ddrh4 ddrh5 ddrh6 ddrh7 cwom0 cwom1 cwom2 cwom3 cwom4 cwom5 1 1 phm0 phm1 phm2 phm3 phm4 phm5 phm6 phm7 pgm0 pgm1 pgm2 pgm3 pgm4 pgm5 pgm6 pgm7 pfm0 pfm1 pfm2 pfm3 pfm4 pfm5 pfm6 pfm7
general release specification july 7, 1997 motorola memory mc68HC05PD6 2-8 rev 1.1 figure 2-7. mc68HC05PD6 option i/o register $10-$1f (optm = 1) read write addr 1 0 2 3 4 5 6 7 register unimplemented $001f user addreess d reg 2 adrd2 w r $001e user addreess d reg 1 adrd1 w r $001d user addreess d reg 0 adrd0 w r $001b user addreess c reg 1 adrc1 w r $001a user addreess c reg 0 adrc0 w r $001c user addreess c reg 2 adrc2 w r $0019 user addreess b reg 2 adrb2 w r $0018 user addreess b reg 1 adrb1 w r $0017 user addreess b reg 0 adrb0 w r $0016 user addreess a reg 2 adra2 w r $0014 user addreess a reg 0 adra0 w r $0013 pd control register 3 pdcr3 w r $0015 user addreess a reg 1 adra1 w r $0012 pd control register 2 pdcr2 w r fa0 fa1 fa2 dpol ds0 ds1 pll0 pll1 $0011 pd control register 1 pdcr1 w r reserved adrf msgf dbf dcf scf errf 0 0 a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 a17 0 0 0 0 0 afns b0 b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 b16 b17 0 0 0 0 0 bfns c0 c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 0 0 0 0 0 cfns d0 d1 d2 d3 d4 d5 d6 d7 d8 d9 d10 d11 d12 d13 d14 d15 d16 d17 0 0 0 0 0 dfns $0010 pd status register pdsr w r adrie msgie dbie dcie fb0 fb1 fb2 pden 0 0 0 0 0 progc 0 0
july 7, 1997 general release specification mc68HC05PD6 memory motorola rev 1.1 2-9 figure 2-8. mc68HC05PD6 option i/o register $20-$2f (optm = 1) read write addr 1 0 2 3 4 5 6 7 register unimplemented $002f unimplemented w r $002e unimplemented w r $002d unimplemented w r $002c unimplemented w r $002a unimplemented w r $0029 $002b unimplemented w r $0028 received msg info reg 2 rmir2 w r $0027 received msg info reg 1 rmir1 w r $0026 received msg info reg 0 rmir0 w r $0025 received addr info reg rair w r $0023 user address f reg 1 adrf1 w r $0022 user address f reg 0 adrf0 w r $0024 user addreess f reg 2 adrf2 w r $0021 user address e reg 2 adre2 w r $0020 user address e reg 1 adre1 w r reserved ra0 ra1 ra2 0 f0 f1 0 0 rmi0 rmi1 rmi2 rmi3 rmi4 rmi5 rmi6 rmi7 rmi8 rmi9 rmi10 rmi11 rmi12 rmi13 rmi14 rmi15 rmi16 rmi17 rmi18 rmi19 0 0 0 0 e8 e9 e10 e11 e12 e13 e14 e15 e16 e17 0 0 0 0 0 efns f0 f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 f13 f14 f15 f16 f17 0 0 0 0 0 ffns user addreess e reg 0 adre0 w r e0 e1 e2 e3 e4 e5 e6 e7
general release specification july 7, 1997 motorola memory mc68HC05PD6 2-10 rev 1.1 figure 2-9. mc68HC05PD6 option i/o register $30-$3f (optm = 1) read write addr 1 0 2 3 4 5 6 7 register unimplemented $003f unimplemented w r $003e miscelleous reg misc w r $003d unimplemented w r $003c unimplemented w r $003a unimplemented w r $0039 unimplemented w r $003b unimplemented w r $0038 unimplemented w r $0037 unimplemented w r $0036 unimplemented w r $0035 unimplemented w r $0033 unimplemented w r $0032 unimplemented w r $0034 unimplemented w r $0031 unimplemented w r $0030 unimplemented w r reserved 0 0 stup ftup optm fosce sys0 sys1
july 7, 1997 general release specification mc68HC05PD6 central processing unit motorola rev 1.1 3-1 section 3 central processing unit the mc68HC05PD6 has a 64 kbytes memory map. the stack has only 64 bytes. therefore, the stack pointer has been reduced to only 6 bits and will only decrement down to $00c0 and then wrap-around to $00ff. all other instructions and registers behave as described in this chapter. 3.1 registers the mcu contains ?e registers which are hard-wired within the cpu and are not part of the memory map. these ?e registers are shown in figure 3-1 and are described in the following paragraphs. figure 3-1. mc68hc05 programming model condition code register i accumulator 60 a index register 71 x 4 52 3 stack pointer sp 14 8 15 9 12 13 10 11 pc cc 111 11 0 0 0 0 0 0 0 0 program counter h nzc half-carry bit (from bit 3) interrupt mask negative bit zero bit carry bit
general release specification july 7, 1997 motorola central processing unit mc68HC05PD6 3-2 rev 1.1 3.2 accumulator (a) the accumulator is a general purpose 8-bit register as shown in figure 3-1 . the cpu uses the accumulator to hold operands and results of arithmetic calculations or non-arithmetic operations. the accumulator is not affected by a reset of the device. 3.3 index register (x) the index register shown in figure 3-1 is an 8-bit register that can perform two functions: indexed addressing temporary storage in indexed addressing with no offset, the index register contains the low byte of the operand address, and the high byte is assumed to be $00. in indexed addressing with an 8-bit offset, the cpu ?ds the operand address by adding the index register content to an 8-bit immediate value. in indexed addressing with a 16-bit offset, the cpu ?ds the operand address by adding the index register content to a 16-bit immediate value. the index register can also serve as an auxiliary accumulator for temporary storage. the index register is not affected by a reset of the device. 3.4 stack pointer (sp) the stack pointer shown in figure 3-1 is a 16-bit register. in mcu devices with memory space less than 64 kbytes the unimplemented upper address lines are ignored. the stack pointer contains the address of the next free location on the stack. during a reset or the reset stack pointer (rsp) instruction, the stack pointer is set to $00ff. the stack pointer is then decremented as data is pushed onto the stack and incremented as data is pulled off the stack. when accessing memory, the ten most signi?ant bits are permanently set to 0000000011. the six least signi?ant register bits are appended to these ten ?ed bits to produce an address within the range of $00ff to $00c0. subroutines and interrupts may use up to 64($c0) locations. if 64 locations are exceeded, the stack pointer wraps around and overwrites the previously stored information. a subroutine call occupies two locations on the stack and an interrupt uses ?e locations.
july 7, 1997 general release specification mc68HC05PD6 central processing unit motorola rev 1.1 3-3 3.5 program counter (pc) the program counter shown in figure 3-1 is a 16-bit register. in mcu devices with memory space less than 64 kbytes the unimplemented upper address lines are ignored. the program counter contains the address of the next instruction or operand to be fetched. normally, the address in the program counter increments to the next sequential memory location every time an instruction or operand is fetched. jump, branch, and interrupt operations load the program counter with an address other than that of the next sequential location. 3.6 condition code register (ccr) the ccr shown in figure 3-1 is a 5-bit register in which four bits are used to indicate the results of the instruction just executed. the ?th bit is the interrupt mask. these bits can be individually tested by a program, and speci? actions can be taken as a result of their states. the condition code register should be thought of as having three additional upper bits that are always ones. only the interrupt mask is affected by a reset of the device. the following paragraphs explain the functions of the lower ?e bits of the condition code register. 3.6.1 half carry bit (h-bit) when the half-carry bit is set, it means that a carry occurred between bits 3 and 4 of the accumulator during the last add or adc (add with carry) operation. the half-carry bit is required for binary-coded decimal (bcd) arithmetic operations. 3.6.2 interrupt mask (i-bit) when the interrupt mask is set, the internal and external interrupts are disabled. interrupts are enabled when the interrupt mask is cleared. when an interrupt occurs, the interrupt mask is automatically set after the cpu registers are saved on the stack, but before the interrupt vector is fetched. if an interrupt request occurs while the interrupt mask is set, the interrupt request is latched. normally, the interrupt is processed as soon as the interrupt mask is cleared. a return from interrupt (rti) instruction pulls the cpu registers from the stack, restoring the interrupt mask to its state before the interrupt was encountered. after any reset, the interrupt mask is set and can only be cleared by the clear i-bit (cli), or wait instructions. 3.6.3 negative bit (n-bit)
general release specification july 7, 1997 motorola central processing unit mc68HC05PD6 3-4 rev 1.1 the negative bit is set when the result of the last arithmetic operation, logical operation, or data manipulation was negative. (bit 7 of the result was a logical one.) the negative bit can also be used to check an often tested ?g by assigning the ?g to bit 7 of a register or memory location. loading the accumulator with the contents of that register or location then sets or clears the negative bit according to the state of the ?g. 3.6.4 zero bit (z-bit) the zero bit is set when the result of the last arithmetic operation, logical operation, data manipulation, or data load operation was zero. 3.6.5 carry/borrow bit (c-bit) the carry/borrow bit is set when a carry out of bit 7 of the accumulator occurred during the last arithmetic operation, logical operation, or data manipulation. the carry/borrow bit is also set or cleared during bit test and branch instructions and during shifts and rotates. this bit is neither set by an inc nor by a dec instruction.
july 7, 1997 general release specification mc68HC05PD6 interrupts motorola rev 1.1 4-1 section 4 interrupts the mcu can be interrupted in seven different ways: non-maskable software interrupt instruction (swi) p-decoder interrupt external interrupt (irq ) key wake-up interrupt (kwi ) timer interrupt sci interrupt rtc interrupt 4.1 cpu interrupt processing interrupts cause the processor to save register contents on the stack and to set the interrupt mask (i-bit) to prevent additional interrupts. unlike reset, hardware interrupts do not cause the current instruction execution to be halted, but are considered pending until the current instruction is complete. if interrupts are not masked (i-bit in the ccr is cleared) and the corresponding interrupt enable bit is set the processor will proceed with interrupt processing. otherwise, the next instruction is fetched and executed. if an interrupt occurs the processor completes the current instruction, then stacks the current cpu register states, sets the i-bit to inhibit further interrupts, and finally checks the pending hardware interrupts. if more than one interrupt is pending following the stacking operation, the interrupt with the highest vector location shown in table 4-1 will be serviced first. the swi is executed the same as any other instruction, regardless of the i-bit state. when an interrupt is to be processed the cpu fetches the address of the appropriate interrupt software service routine from the vector table at locations $fff0 thru $ffff as defined in table 4-1 . an rti instruction is used to signify when the interrupt software service routine is completed. the rti instruction causes the register contents to be recovered from the stack and normal processing to resume at the next instruction that was to be executed when the interrupt took place. figure 4-1 shows the sequence of events that occur during interrupt processing.
general release specification july 7, 1997 motorola interrupts mc68HC05PD6 4-2 rev 1.1 table 4-1. vector address for interrupts and reset function source local mask global mask priority vector address reset power-on logic none none 1 $fffe-$ffff reset pin none cop watchdog cope bit swi user code none none same priority as instruction $fffc-$fffd p-decoder interrupts dcf bit dcie i bit 2 $fffa-$fffb dbf bit dbie msgf bit msgie adrf bit adrie external interrupts irq1f bit irq1e i bit 3 $fff8-$fff9 irq2f bit irq2e key wake-up kwif bit kwie i bit 4 $fff6-$fff7 timer interrupts ti2f bit ti2ie i bit 5 $fff4-$fff5 oc2f bit oc2ie icf bit icie oc1f bit oc1ie tof bit toie sci interrupts tdre bit tie i bit 6 $fff2-$fff3 tc bit tcie rdrf bit rie idle bit ilie rtc interrupts rtcf bit rtce i bit 7 $fff0-$fff1 alf bit ale secf bit sece
july 7, 1997 general release specification mc68HC05PD6 interrupts motorola rev 1.1 4-3 figure 4-1. interrupt processing flowchart 4.2 reset interrupt sequence the reset function is not in the strictest sense an interrupt; however, it is acted upon in a similar manner. a low level input on the reset pin or an internally generated reset signal causes the program to vector to its starting address which is specified by the contents of $fffe and $ffff. the i-bit in the condition code register is also set. the mcu is configured to a known state during this type of reset as described in section 5 . 4.3 software interrupt (swi) the swi is an executable instruction and a non-maskable interrupt since it is executed regardless of the state of the i-bit in the ccr. if the i-bit is zero (interrupts enabled), the n n n n y y y y from reset is i-bit set? load interrupt vectors to pc set i-bit in ccr pc -> (sp,sp-1) x -> (sp-2) a -> (sp-3) cc -> (sp-4) clear irq latch restore registers from stack cc, a, x, pc irq external interrupt? execute instruction fetch next instruction rti instruction ? swi instruction ? n y internal interrupt ?
general release specification july 7, 1997 motorola interrupts mc68HC05PD6 4-4 rev 1.1 swi instruction executes after interrupts which were pending before the swi was fetched, or before interrupts generated after the swi was fetched. the interrupt service routine address is specified by the contents of $fffc and $fffd. 4.4 hardware interrupts all hardware interrupts except reset are maskable by the i-bit in the ccr. if the i-bit is set, all hardware interrupts (internal and external) are disabled. clearing the i-bit enables the hardware interrupts. there are four types of hardware interrupts which are explained in the following sections. 4.4.1 p-decoder interrupt (pdi) the p-decoder interrupt vectors located at $fffa and $fffb. it contains four interrupt sources (dci, dbi, msgi, adri). these interrupts are generated only if the corresponding enable bit is set and the i bit of the ccr is cleared. see section 12 for more information on p-decoder interrupts. 4.4.2 irq1 and irq2 two external interrupt request inputs, irq1 and irq2 share the same vector address at $fff8 and $fff9. if the irq option is edge and level sensitive triggering (irq x s=0), a low level at the irq pin and a cleared interrupt mask bit of the condition code register will cause an external interrupt to occur. if the mcu has finished with the interrupt service routine, but the irq pin is still low, the external interrupt will start again. in fact, the mcu will keep on servicing the external interrupt as long as the irq pin is low. if the irq pin goes low for a while and resumes to high (a negative pulse) before the interrupt mask bit is cleared, the mcu will not recognize there was an interrupt request, and no interrupt will occur after the interrupt mask bit is cleared. irq x s is located in interrupt control register (intcr). if the irq option is negative edge sensitive triggering (irq x s=1), a negative edge occurs at the irq pin and a cleared interrupt mask bit of the condition code register will cause an external interrupt to occur. if the mcu has finished with the interrupt service routine, but the irq pin has not returned back to high, no further interrupt will be generated. the interrupt logic recognizes negative edge transitions and pulses (special case of negative edges) only. if the negative edge occurs while the interrupt mask bit is set, the interrupt signal will be latched, and interrupt will occur as soon as the interrupt mask bit is cleared. the latch will be cleared by reset or cleared automatically during fetch of the external interrupt vectors. therefore, one (and only one) external interrupt edge could be latched while the interrupt mask bit is set. the irq1 and irq2 are enabled by irq1e and irq2e bits and irq1f and irq2f bits are provided as an indicator in the interrupt status register (intsr). since the irq1(2)f
july 7, 1997 general release specification mc68HC05PD6 interrupts motorola rev 1.1 4-5 can be set by either the pins or the data latches of pc7(6), be sure to clear the flags by software before setting the irq1(2)e bit. the irq1 and the irq2 pins are shared with the port c bit 7 and bit 6, respectively, and irq x pin states can be determined by reading port c pins. the bil and bih instructions apply only to the irq1 input. figure 4-2. external interrupt d c q h r s e l irq1s q r s irq1f read intsr for bih/bil d c q h r s e l irq2s q r s irq2f read intsr data bus data bus reset/por irq1e irq2e write 1 to rirq2 irq2 (pc6) irq1 (pc7) reset/por write 1 to rirq1 int 0 1 1 0
general release specification july 7, 1997 motorola interrupts mc68HC05PD6 4-6 rev 1.1 4.4.3 key wake-up interrupt (kwi ) the eight key wake-up interrupt vectors located at $fff6 and $fff7. these eight key wake-up inputs (kwi0 -kwi7 ) share pins with port b. provided the i bit in ccr is cleared, each key wake-up input is enabled by the corresponding bit in the kwien register, and key wake-up interrupt (kwi) is enabled by the kwie bit in the intcr. when a falling edge is detected at one of the enabled key wake-up inputs, the kwif bit in the intsr is set and kwi is generated if kwie = 1. each input has a latch which responds only to the falling edge at the pin and all input latches are cleared at the same time by clearing kwif bit (see figure 4-3 ). figure 4-3. key wake-up interrupt (kwi) d c q h r read kwif kwie0 kwi0 (pb0) q r s kwif d c q h r kwie1 kwi1 (pb1) d c q h r kwie7 kwi7 (pb7) reset/por kwi kwi2 to kwi6 write 1 to rkwif kwie
july 7, 1997 general release specification mc68HC05PD6 interrupts motorola rev 1.1 4-7 4.4.4 timer interrupt timer 1 and timer 2 interrupts share the same interrupt vector at $fff4 and $fff5. timer 1 contains three interrupt sources (toi, ici and oc1i) and timer 2 contains two interrupt sources (ti2i and oc2i). these interrupts are generated only if the corresponding enable bit is set and the i bit of the ccr is cleared. see section 9 for more information on timer interrupts. 4.4.5 serial communication interface (sci) the sci interrupt use the vector at $fff2 and $fff3. the sci interrupt occurs when one of the interrupt flag bits in the serial communications status register is set, provided the i bit in the ccr is clear and the enable bit in the serial communications control register 2 is set. software in the serial interrupt service routine must determine the cause and priority of the sci interrupt by examining the interrupt flags and status bits in the sci status register. see section 11 for more information on sci interrupts. 4.4.6 real time clock interrupt (rtc) the rtc interrupt is enabled when either rtce, ale or sece bit in the control register is set, provided the interrupt mask bit of the ccr is cleared. the interrupt service routine address is specified by the contents of $fff0 and $fff1. 4.4.7 interrupt control register (intcr) irq1e ?interrupt 1 enable irq1e bit enables irq1 interrupt when irq1f is set. this bit is cleared on reset. 0 = irq1 interrupt is disabled 1 = irq1 interrupt is enabled irq2e ?interrupt 2 enable irq2e bit enables irq2 interrupt when irq2f is set. this bit is cleared on reset. 0 = irq2 interrupt is disabled 1 = irq2 interrupt is enabled w r intcr $0008 reset t irq1e 0 7 00 54 0 0000 6 3210 irq2e irq1s irq2s kwie
general release specification july 7, 1997 motorola interrupts mc68HC05PD6 4-8 rev 1.1 kwie ?key wake-up enable key wake-up interrupt (kwi) enable bit enables key wake-up interrupt when kwif is set. this bit is cleared on reset. 0 = kwi is disabled 1 = kwi is enabled irq1s ?irq1 select edge sensitive only 0 = irq1 is con?ured for low level and negative edge sensitive 1 = irq1 is con?ured to respond only to negative edges irq2s ?irq2 select edge sensitive only 0 = irq2 is con?ured for low level and negative edge sensitive 1 = irq2 is con?ured to respond only to negative edges 4.4.8 interrupt status register (intsr) irq1f ?irq1 interrupt flag when irq1s = 0, the falling edge or low level at irq1 pin sets irq1f. when irq1s = 1, only the falling edge at pin sets irq1f bit. if irq1e bit and this bit are set, an interrupt is generated. this bit is read only bit and cleared by writing a 1 to the rirq1 bit. reset clears this bit. irq2f ?irq2 interrupt flag when irq2s = 0, the falling edge or low level at irq2 pin sets irq2f. when irq2s = 1, only the falling edge at pin sets irq2f bit. if irq2e bit and this bit are set, an interrupt is generated. this bit is read only bit and cleared by writing a 1 to the rirq2 bit. reset clears this bit. kwif ?key wake-up interrupt flag when kwie x bit in the kwien register is set, the falling edge at kwi x pin sets kwif bit. if kwie bit and this bit are set, an interrupt is generated. this bit is a read only bit and clearing kwif is accomplished by writing a 1 to the rkwif bit. reset clears this bit. rirq1 ?reset irq1 flag the rirq1 bit is a write only bit and always read as 0. writing a 1 to this bit clears the irq1f bit and writing 0 to this bit has no effect. w r intsr $0009 reset t irq1f 0 7 00 54 0 0000 6 3210 irq2f rirq1 rirq2 kwif rkwif 0 0 0 0 0
july 7, 1997 general release specification mc68HC05PD6 interrupts motorola rev 1.1 4-9 rirq2 ?reset irq2 flag the rirq2 bit is a write only bit and always read as 0. writing a 1 to this bit clears the irq2f bit and writing a 0 to this bit has no effect. rkwif ?reset kwi flag the rkwif bit is a write only bit and always read as 0. writing a 1 to this bit clears the kwif bit and writing a 0 to this bit has no effect. 4.4.9 key wake-up input enable register (kwien) kwie x ?key wake-up input enable (bit x ) when kwie x bit is set, the kwi x (pb x ) input is enabled for key wake-up interrupt. this bit is cleared on reset. w r kwien $000f reset t kwie7 0 7 00 54 0 0000 6 3210 kwie6 kwie3 kwie2 kwie1 kwie0 kwie5 kwie4 option map
general release specification july 7, 1997 motorola interrupts mc68HC05PD6 4-10 rev 1.1
july 7, 1997 general release specification mc68HC05PD6 resets motorola rev 1.1 5-1 section 5 resets the mcu can be reset in four ways: by an active low input to the reset pin, by initial power-on reset, by cop watchdog reset, and by an illegal address access. the reset pin is an i/o pin as shown in figure 5-1 . all the peripheral modules which drive external pins will be reset by the synchronous reset signal (rst) coming from a latch, which is synchronized to the internal bus clock and set by any of the four reset sources. figure 5-1. reset block diagram 5.1 external reset (reset ) the reset pin is the only external reset source. this pin is connected to a schmitt trigger input gate to provide an upper and lower threshold voltage separated by a minimum amount of hysteresis. this external reset occurs whenever the reset pin is pulled below illegal address reset (iladr) cpu latch cop watchdog (copr) rst osc data address ph2 to other peripherals mode select to irq logic latch power-on reset (por) v dd address irq1 irq2 reset opcode
general release specification july 7, 1997 motorola resets mc68HC05PD6 5-2 rev 1.1 the lower threshold and remains in reset until the reset pin rises above the upper threshold. this active low input will generate the rst signal and reset the cpu and peripherals. termination of the external reset input can alter the operating mode of the mcu. note activation of the rst signal is generally referred to as reset of the device, unless otherwise speci?d. 5.2 internal resets the three internally generated resets are the initial power-on reset, the cop watchdog timer reset, and the illegal address reset 5.2.1 power-on reset (por) the internal por is generated on power-up to allow the clock oscillator to stabilize. the por is strictly for power-on condition and is not able to detect a drop in the power supply voltage (brown-out). there is an oscillator stabilization delay of 8072 osc clock cycles after the oscillator becomes active. the por will generate the rst signal which will reset the cpu. if any other reset function is active at the end of this 8192 cycles delay, the rst signal will remain in the reset condition until the other reset conditions end. 5.2.2 computer operating properly reset (copr) the internal copr reset is generated automatically (if enabled) by a time-out of the cop watchdog timer. this time-out occurs if the counter in the cop watchdog timer is not reset (cleared) within a specific time by a program reset sequence. see section 8 for more information on this time-out feature. 5.2.3 illegal address reset (iladr) the mcu monitors all opcode fetches. if an illegal address is accessed during an opcode fetch, an internal reset is generated. illegal address space consists of all unused locations within the memory space and the i/o registers. (see figure 2-1 for mc68HC05PD6 memory map.) because the internal reset signal is used, the mcu comes out of an iladr reset in the same operating mode it was in when the opcode was fetched.
july 7, 1997 general release specification mc68HC05PD6 low power modes motorola rev 1.1 6-1 section 6 low power modes the mc68HC05PD6 has two operating modes: single-chip (normal) mode, and self-check mode. the single-chip mode is the normal operating mode for the mcu. the mode of operation is determined by the logic state on pc6 and pc7 pins, and the voltage on v pp on the rising edge of the external reset input. 6.1 single-chip (normal) mode the single-chip mode allows the mcu to function as a self-contained microcontroller, with maximum use of the pins for on-chip peripheral functions. in the single-chip mode all address and data activity occurs within the mcu and is not available externally. single-chip mode is entered if the vpp pin is within the normal operating voltage range when the rising edge of a reset . in single-chip mode, all i/o port pins are available. 6.2 self-check mode the self-check program is mask at location $fe00 to $ffdf, and is used for checking device functionality under minimum hardware support. 6.3 low-power modes in each of its con?uration modes the mcu is capable of running in one of several low-power operating modes. the wait and stop instructions provide two modes that reduce the power required for the mcu by stopping various internal clocks and/or the oscillator. the ?w of the stop, and wait modes are shown in figure 6-1 . table 6-1. operating mode initialization mode reset pc7/irq1 pc6/irq2 vpp single-chip (normal) v ss to v dd v ss to v dd v ss to v dd self-check v ss v dd v tst v tst =2 x v dd
general release specification july 7, 1997 motorola low power modes mc68HC05PD6 6-2 rev 1.1 6.3.1 stop instruction the stop instruction places the mcu in its lowest power consumption mode. in stop mode, the internal main oscillator osc is turned off, halting all internal processing, including timer operations (timer1, timer2, and cop watchdog timer). sub oscillator xosc does not stop oscillating. therefore if xosc is used as the clock source for cop, cop is still functional in stop mode. see section 8 on clock distribution. during the stop mode, the tcr bits are altered to remove any pending timer interrupt request and to disable any further timer interrupts. the timer prescaler is cleared. the i bit in the ccr is cleared to enable external interrupts. all other registers and memory remain unaltered. all input/output lines remain unchanged. the processor can be brought out of the stop mode only by reset or interrupt from irq1 , irq2 , kwi , pdi, or rtc. 6.3.2 wait instruction the wait instruction places the mcu in a low-power consumption mode, but the wait mode consumes more power than the stop mode. all cpu action is suspended, but on-chip peripherals and oscillators remain active. any interrupt or reset (including a cop reset) will cause the mcu to exit the wait mode. during the wait mode, the i bit in the ccr is cleared to enable interrupts. all other registers, memory, and input/output lines remain in their previous state. the timers may be enabled to allow a periodic exit from the wait mode. wait mode must be exited and the cop must be reset to prevent a cop time-out. the reduction of power in the wait mode depends on how many of the on-chip peripheral's clock can be shut down. therefore the amount of power that will be consumed is very dependent on the application and that it would be prohibitive to test all parts for all variations. for these reasons the data sheet will include values for a limited number of variations. these variations and the corresponding max power consumptions will be decided upon after initial characterization of silicon.
july 7, 1997 general release specification mc68HC05PD6 low power modes motorola rev 1.1 6-3 figure 6-1. clock state and stop recovery/por delay diagrams state c cpu: run ph2: x1/64 x1: on x2: on state b cpu: run ph2: x1/4 x1: on x2: on state d cpu: run ph2: x2/2 x1: on x2: on state a cpu: run ph2: x1/2 x1: on x2: on state e cpu: run ph2: x2/2 x1: off x2: on x1en=1 x1en=0 state a state b state c stop state d state e delay power on int reset int stop stop reset, int reset int note: ph2 is at same frequency as internal processor clock e x1=osc x2=xosc x1en=fosce low power high speed stop ? e ? d ? c ? b ? a
general release specification july 7, 1997 motorola low power modes mc68HC05PD6 6-4 rev 1.1 figure 6-2. stop/wait flowcharts reset ? oscillator active timer clock active processor clocks stopped clear i bit if fosce = 1 turn on oscillator osc wait for time delay to stabilize 1. fetch reset vector or 2. service interrupt 3. a. stack 4. b. set i bit 5. c. vector to interrupt routine restart processor clock stop wait stop oscillator osc and all clocks except xosc clear i bit y y y y n n n external interrupt irq ? y n kwi interrupt ? y n sci interrupt ? y n pdi interrupt ? y n rtc interrupt ? external interrupt irq ? reset ? y n timer interrupt ? kwi interrupt ? n n n y y rtc interrupt ? pdi interrupt ? n y fetch reset vector or service interrupt a. stack b. set i bit c. vector to interrupt routine fetch reset vector or service interrupt a. stack b. set i bit c. vector to interrupt routine
july 7, 1997 general release specification mc68HC05PD6 input/output ports motorola rev 1.1 7-1 section 7 input/output ports the mc68HC05PD6 a has 8 parallel ports a, b, c, d, e, f, g and h. port a, b, c, f, g and h have 8 i/o pins, port d and e have 8 output-only pins. the individual bits in these ports are programmable as either inputs or outputs under software control by the data direction registers (ddrs). all of these pins except port a serve multiple purposes depending on the con?uration of these pins. 7.1 port a port a is an 8-bit bidirectional general purpose port. the data direction of a port a pin is determined by its corresponding ddra bit. when a port a pin is programmed as an output by the corresponding ddra bit, data in the porta data register becomes output data to the pin and this data is returned when porta register is read. open drain or cmos outputs are selected by awomh and awoml bits in the wom1 register. if the awomh bit is set, the p-channel drivers of output buffers of bit 7 thru bit 4 are disabled (open drain). if the awoml bit is set, the p-channel drivers of output buffers of bit 3 thru bit 0 are disabled (open drain). when a pin is programmed as input by the corresponding ddra bit, the pin level is read by the cpu. port a has an optional pull-up resistors. when the rah or ral bit in the rcr1 is set, pull-up resistors are attached to the upper 4 bits or lower 4 bits of port a pins, respectively. (the typical resistor values are 200k w at v dd =3v.) when a pin outputs a low level, the pull-up resistor is disconnected regardless of rah or ral bit state. 7.2 port b port b pins serve two basic functions: key wake-up interrupt (kwi) input pins and general purpose i/o pins. each kwi input is enabled or disabled by the corresponding kwie x bit in the kwien register, and the usage of the kwi input does not affect the general purpose input function. when any of these bits is used as port b i/o, the
general release specification july 7, 1997 motorola input/output ports mc68HC05PD6 7-2 rev 1.1 corresponding kwie x bit in the kwien should be disabled, otherwise kwi interrupt will occur. when a port b pin is programmed as an output by the corresponding ddrb bit, data in the portb data register becomes output data to the pin and this data is returned when portb register is read. pull-up resistors are provided for both upper and lower 4 bits of port b pins which are controlled by the rbh and rbl bits, respectively, in the rcr1 register. (the typical resistor values are 200k w at v dd =3v.) 7.3 port c port c pins share functions with several on chip peripherals. a pin function is controlled by the enable bit of each associated peripheral. bit 7 and bit 6 of port c are general purpose i/o pins and irq input pins. the ddrc7/6 bits determine whether the pin states or the data latch states should be read by the cpu. since irq1(2)f can be set by either the pins or the data latches, when using irqs, be sure to clear the ?gs by software before enabling the irq1(2)e bits. the pc5 pin is a general purpose i/o pin and the direction of the pin is determined by the ddrc5 bit in the data direction register c (ddrc). when the event output (evo) is enabled, the pc5 is con?ured as an event output pin and the ddrc5 bit has meaning only for the read of pc5 bit in the portc register; if the ddrc5 is set the pc5 data latch is read by the cpu, otherwise pc5 pin level (evo state) is read. when evo is disabled, it becomes general purpose i/o pin, pc5. this pc5/evo output has the capability to drive 10 ma source current when (v oh 3 vdd?.8v). the pc4 and pc3 pins share functions with the timer input pins (evi and tcap). these bits are not affected by the usage of timer input functions and the directions of pins are always controlled by the ddrc4 and ddrc3 bits. also the ddrc4 and ddrc3 bits determine whether the pin states or data latch states should be read by the cpu. note since the tcap pin is shared with the pc3 i/o pin, changing the state of the pc3 ddr or data register can cause an unwanted tcap interrupt. this can be handled by clearing the icie bit before changing the con?uration of pc3, and clearing any pending interrupts before enabling icie.
july 7, 1997 general release specification mc68HC05PD6 input/output ports motorola rev 1.1 7-3 note since the evi pin is shared with the pc4 i/o pin, ddrc4 should always be cleared whenever evi is used. evi should not be used when ddrc4 is high. the pc2 pin is a general purpose i/o pin and the direction of the pin is determined by the ddrc2 bit in the data direction register c (ddrc). when the output compare (tcmp) is enabled, the pc2 is con?ured as tcmp output pin and the ddrc2 bit has meaning only for the read of pc2 bit in the portc register; if the ddrc2 is set the pc2 data latch is read by the cpu, otherwise pc2 pin level is read. when tcmp is disabled, it becomes general purpose i/o pin, pc2. this pc2/tcmp output has the capability to drive 10 ma source current when (v oh 3 vdd?.8v). the pc1 thru pc0 pins are shared with the serial communication interface (sci). when the sci is not used (te, re = 0), ddrc1 and ddrc0 bits control the directions of the pins, and when the sci is enabled, the pins are con?ured as transmit data out (tdo) and receive data in (rdi). when the portc is read, the value read will be determined by the data direction register. when the port is con?ured for input (ddrc1 or ddrc0 equal to 0) the pin state is read. when the port is con?ured for output (ddrc1 or ddrc0 equal to 0) output data latch is read. each port c pin has pull-up resistor option which is controlled by the corresponding rcr2 register bit. (the typical resistor values are 200k w at v dd =3v.) when a pin outputs low, the resistor is disconnected regardless of a rcr2 register bit being set. bit 5 thru bit 0 have open drain or cmos output options, which are controlled by the corresponding wom2 register bits. these open drain or cmos output options may be selected for either the general purpose output ports or the peripheral outputs (evo, tcmp, and tdo). 7.4 port d port d pins serve one of two basic functions depending on the mcu mode selected; lcd frontplanes and backplanes driver outputs, or general purpose output pins. since port d is an output only port there is no ddrd register. in place of ddrd is port d mux control register (pdmux). bits 7-4 of this register control the port/lcd muxing of port d bits 7-4 respectively on a bit-wise basis. these bits are cleared on reset, and writing a 1 to any bit will turn that pin into a port output. these outputs have the capability to drive 10 ma sink current when (vol vss + 0.8v).
general release specification july 7, 1997 motorola input/output ports mc68HC05PD6 7-4 rev 1.1 on reset, all port d outputs are disconnected from the pins and the port d data latches are set to 1. the pin connections of the lower 4-bits of port d depend on the lcd duty selection by the dutys bit in the lcdcr. when the lcd duty is not ?/4? the unused backplanes driver(s) is (are) replaced by the port d output pin(s) automatically. if dwomh or dwoml bits in the wom1 register is set, the p-channel drivers of output buffers at the upper 4 bits or lower 3 bits, respectively are disabled (open drain mode). this open drain controls do not apply to the pins which are con?ured as frontplanes or backplanes driver outputs. 7.4.1 port d mux register (pdmux) when pdm x is set, the corresponding pin, pd x , is con?ure to port d output. when pdm x is clear, the corresponding pin, pd x , is con?ure to lcd output. 7.5 port e port e pins serve one of two basic functions depending on the mcu mode selected: lcd frontplanes driver outputs, or general purpose output pins. since port e is an output only port there is no ddre register.in place of ddre is port e mux control register (pemux). bits 7-0 of this register control the port/lcd muxing of port e bits 7-0 respectively on a bit-wide basis. these bits are cleared on reset, and writing a 1 to any bit will turn that pin into a port output. these outputs have the capability to drive 10 ma sink current when (vol vss + 0.8v). on reset, all port e outputs are disconnected from the pins and the port e data latches are set to 1. if ewomh or ewoml bits in the wom1 register is set, the p-channel driver of output buffers at the upper or lower 4 bits, respectively, are disabled (open drain mode). this open drain controls do not apply to the pins which are con?ured as frontplanes driver outputs. w r pdmux $0003 reset t pdm7 0 7 00 54 0 0000 6 3210 pdm6 pdm4 pdm5 0 00 0 option map
july 7, 1997 general release specification mc68HC05PD6 input/output ports motorola rev 1.1 7-5 7.5.1 port e mux register (pemux) when pem x is set, the corresponding pin, pe x , is con?ure to port e output. when pem x is clear, the corresponding pin, pe x , is con?ure to lcd output. 7.6 port f, port g and port h port f, port g and port h serve one of two basic functions depending on the mcu mode selected; lcd frontplanes driver outputs, or general purpose i/o pins. their mux control register (pfmux, pgmux, phmux) control the port/lcd muxing of corresponding port on a bit-wide basis. these bits are cleared on reset, and writing a 1 to any bit will turn that pin into a port output. these outputs have the capability to drive 10 ma sink current when (vol vss + 0.8v). the data direction of a port pin is determined by its corresponding ddr bit. when a port pin is programmed as an output by the corresponding ddr bit, data in the port data register becomes output data to the pin and this data is returned when port register is read. 7.6.1 port f mux register (pfmux) when pfm x is set, the corresponding pin, pf x , is con?ure to port f i/o. when pfm x is clear, the corresponding pin, pf x , is con?ure to lcd output. w r pemux $0004 reset t pem7 0 7 00 54 0 0000 6 3210 pem6 pem4 pem5 pem3 pem2 pem0 pem1 option map w r pfmux $000c reset t pfm7 0 7 00 54 0 0000 6 3210 pfm6 pfm4 pfm5 pfm3 pfm2 pfm0 pfm1 option map
general release specification july 7, 1997 motorola input/output ports mc68HC05PD6 7-6 rev 1.1 7.6.2 port g mux register (pgmux) when pgm x is set, the corresponding pin, p gx , is con?ure to port g i/o. when pgm x is clear, the corresponding pin, p gx , is con?ure to lcd output. 7.6.3 port h mux register (phmux) when phm x is set, the corresponding pin, ph x , is con?ure to port h i/o. when phm x is clear, the corresponding pin, ph x , is con?ure to lcd output. 7.7 input/ouput programming bidirectional port lines may be programmed as an input or an output under software control. the direction of the pins is determined by the state of the corresponding bit in the port data direction register (ddr). each port has an associated ddr. any i/o port pin is con?ured as an output if its corresponding ddr bit is set. a pin is con?ured as an input if its corresponding ddr bit is cleared. during reset, all ddrs are cleared, which con?ure all port pins as inputs. the data direction registers are capable of being written to or read by the processor. during the programmed output state, a read of the data register actually reads the value of the output data latch and not the i/o pin. see figure 7-1 and table 7-1 . w r pgmux $000d reset t pgm7 0 7 00 54 0 0000 6 3210 pgm6 pgm4 pgm5 pgm3 pgm2 pgm0 pgm1 option map w r phmux $000e reset t phm7 0 7 00 54 0 0000 6 3210 phm6 phm4 phm5 phm3 phm2 phm0 phm1 option map
july 7, 1997 general release specification mc68HC05PD6 input/output ports motorola rev 1.1 7-7 figure 7-1. port i/o circuitry table 7-1. i/o pin functions note a ?litch can be generated on an i/o pin when changing it from an input to an output unless the data register is ?st pre-conditioned to the desired state before changing the corresponding ddr bit from a zero to a one. 7.8 port option control registers 7.8.1 resistor control register 1 (rcr1) r/w ddr i/o pin functions 0 0 the i/o pin is in input mode. data is written into the output data latch. 0 1 data is written into the output data latch and output to the i/o pin. 1 0 the state of the i/o pin is read. 1 1 the i/o pin is in output mode. the output data latch is read. i/o pin read data write data data register bit internal hc05 data bus reset (rst) read/write ddr data direction register bit output w r rcr1 $0008 reset t 0 0 7 00 54 0 0000 6 3210 0 rbh rbl rah ral 00 option map
general release specification july 7, 1997 motorola input/output ports mc68HC05PD6 7-8 rev 1.1 rbh ?port b pull up resistor (h) when this bit is set, pull up resistors are connected to the upper 4 bits of port b pins. this bit is cleared on reset. rbl?port b pull up resistor (l) when this bit is set, pull up resistors are connected to the lower 4 bits of port b pins. this bit is cleared on reset. rah ?port a pull up resistor (h) when this bit is set, pull up resistors are connected to the upper 4 bits of port a pins. this bit is cleared on reset. ral ?port a pull up resistor (l) when this bit is set, pull up resistors are connected to the lower 4 bits of port a pins. this bit is cleared on reset. the typical resistor values are 200k w at v dd =3v for both port a and port b. when a pin outputs a low level, the pull-up resistor is disconnected regardless of pull-up enable state. 7.8.2 resistor control register 2 (rcr2) rc x ?port c pull up resistor (bit x ) when rc x bit is set, pull up resistor is connected to the corresponding bit of port c pin. this bit is cleared on reset. the typical resistor values are 200k w at v dd =3v. 7.8.3 open drain output control register 1 (wom1) dwomh ?port d open drain mode (h) when this bit is set, the upper 4 bits of port d are con?ured as open drain outputs if these bits are selected as port d output by the pdm x bits in the pdmux. this bit is cleared on reset. w r rcr1 $0009 reset t rc7 0 7 00 54 0 0000 6 3210 rc6 rc3 rc2 rc1 rc0 rc5 rc4 option map w r wom1 $000a reset t dwomh 0 7 00 54 0 0000 6 3210 dwoml 0 awomh awoml ewomh ewoml option map 0
july 7, 1997 general release specification mc68HC05PD6 input/output ports motorola rev 1.1 7-9 dwoml ?port d open drain mode (l) when this bit is set, the lower 4 bits of port d are con?ured as open drain outputs if the corresponding bp x pin is not used by the lcd driver. this bit is cleared on reset. ewomh ?port e open drain mode (h) when this bit is set, the upper 4 bits of port e that are con?ured as i/o output by the pem x bits in the pemux are con?ured as open drain outputs. this bit is cleared on reset. ewoml ?port e open drain mode (l) when this bit is set, the lower 4 bits of port e that are con?ured as i/o output by the pem x bits in the pemux are con?ured as open drain outputs. this bit is cleared on reset. awomh ?port a open drain mode (h) when this bit is set, upper 4 bits of port a that are con?ured as output (corresponding ddra bit set) becomes open drain outputs. this bit is cleared on reset. awoml ?port a open drain mode (l) when this bit is set, lower 4 bits of port a that are con?ured as output (corresponding ddra bit set) becomes open drain outputs. this bit is cleared on reset. 7.8.4 open drain output control register 2 (wom2) cwom x ?port c open drain mode (bit x ) when cwom x bit is set, port c bit x are con?ured as open drain outputs if ddrc x is set. this bit is cleared on reset. w r wom2 $000b reset t 1 1 7 00 54 1 0000 6 3210 1 cwom3 cwom2 cwom1 cwom0 cwom5 cwom4 option map
general release specification july 7, 1997 motorola input/output ports mc68HC05PD6 7-10 rev 1.1
july 7, 1997 general release specification mc68HC05PD6 clock distribution motorola rev 1.1 8-1 section 8 clock distribution there are two oscillator blocks: osc and xosc. several combinations of the clock distributions are allowed for the modules in the mc68HC05PD6. refer to the following block diagram. figure 8-1. clock signal distribution 8.1 osc clock divider and por counter the osc clock is divided by a 7 bit counter which is used for the system clock, time base and por counter. clocks divided by 2, 4, and 64 are available for the system clock selections and clock divided by 128 is provided for the time base and por counter. the por counter is a 6 bit clock counter that is driven by the osc divided by 128. the over?w of this counter is used for setting ftup bit, release of power on reset (por), and resuming operation from stop mode. xosc1 xosc2 stop osc1 osc2 1/2 0 1/2 1 1/2 5 sys1 sys0 sel 1/2 osc divider (7 bit) osc xosc clk ctrl por (6 bit) timebase timer2 timer1 sci cpu lcd driver & ports wait exclk 1/2 0 1/2 7 1/2 7 xclk fosce/ pwron system clock ftup 1/2 rtc p-decoder
general release specification july 7, 1997 motorola clock distribution mc68HC05PD6 8-2 rev 1.1 the 7 bit divider and por counter are initialized to $0078 by the following conditions. power on detection when fosce bit is cleared 8.2 system clock control the system clock is provided for all internal modules except time base. both osc and xosc are available as the system clock source. the divide ratio is selected by the sys1 and sys0 bits in the misc register. by default osc divided by 64 is selected on reset. 8.3 osc and xosc the secondary oscillator (xosc) runs continuously after power-up. the main oscillator (osc) can be stopped to conserve power via the stop instruction or the fosce bit in the misc register. the effects of restarting the osc will vary depending on current state of the mcu, including sys0:1 and fosce. 8.3.1 osc on line if the system clock is osc, fosce should remain 1. executing the stop instruction in this condition will halt osc, put the mcu into a low power mode and clear the 6-bit por counter. the 7-bit divider is not initialized. exiting stop with external irq or reset re-starts the oscillator. when the por counter over?ws, internal reset is released and execution can begin. the stabilization time will vary between 7944 and 8072 counts. note exiting stop with external reset will always return the mcu to the state as de?ed by the register de?itions. i.e. sys0:1=1:0, fosce=1. table 8-1. system clock frequencies sys1 sys0 divide ratio osc=4mhz osc=4.1943mhz xosc=76.8khz 0 0 osc ? 2 2mhz 2.0972mhz 0 1 osc ? 4 1mhz 1.0486mhz 1 0 osc ? 64 62.5khz 65.536khz 1 1 xosc ? 4 19.2khz
july 7, 1997 general release specification mc68HC05PD6 clock distribution motorola rev 1.1 8-3 8.3.2 xosc on line if xosc is the system clock (sys0:1=1:1), osc can be stopped either by the stop instruction or by clearing the fosce bit. the sub oscillator (xosc) never stops except during power down. this clock may also be used as the clock source of the system clock and time base. 8.3.2.1 xosc with fosce=1 if the system clock is xosc and fosce=1, executing the stop instruction will halt osc, put the mcu into a low power mode and clear the 6-bit por counter. the 7-bit divider is not initialized. exiting stop with external irq re-starts the oscillator, however execution begins immediately using xosc. when the por counter over?ws, ftup is set signaling that osc is stable and osc can be used as the system clock. the stabilization time will vary between 7944 and 8072 counts. 8.3.2.2 xosc with fosce=0 if xosc is the system clock, clearing fosce will stop osc, and preset the 7-bit divider and 6-bit por counter to $0078. execution will continue with xosc and when fosce is set again, osc will re-start. when the por counter over?ws, ftup is set signaling that osc is stable and osc can be used as the system clock. the stabilization time will be 8072 counts. 8.3.2.3 xosc with fosce=0 and stop if xosc is the system clock and fosce is cleared, further power reduction can be achieved by executing the stop instruction. in this case osc is stopped, the7- bit divider and 6-bit por counter is preset to $0078 (since fosce=0) and execution is halted. exiting stop with external irq does not re-start the osc, however execution begins immediately using xosc. osc may be re-started by setting fosce, and when the por counter over?ws, ftup will be set signaling that osc is stable and can be used as the system clock. the stabilization time will be 8072 counts. 8.3.2.4 stop and wait modes during stop mode the main oscillator (osc) is shut down and the clock path from the second oscillator (xosc) is disconnected, such that all modules except time base are halted. entering stop mode clears ftup ?g in the misc register, and initializes por counter. the stop mode is exited by reset, pdi, irq1, irq2, kwi, or rtc interrupt.
general release specification july 7, 1997 motorola clock distribution mc68HC05PD6 8-4 rev 1.1 if osc is selected as system clock source during stop mode, cpu resumes after the over?w of por counter and this over?w also sets ftup status ?g. if xosc is selected as system clock source during stop mode, no stop recovery time is required for exiting stop mode because xosc never stops and re-start of main oscillator depends on fosce bit. during wait mode, only the cpu clocks are halted and the peripheral modules are not affected. the wait mode is exited by the reset and any interrupts. 8.4 time base time base is a 14 bit up-counter which is clocked by xosc input or osc input divided by 128. tbclk bit in the tbcr1 register selects the clock source. this 14 bit divider is initialized to $0078 only upon power on reset (por). after counting 8072 clocks, the stup bit in the misc register is set. the divided clocks from the time base are used for lcdclk, stup, and cop. table 8-2. recovery time requirements before reset or interrupt power-on reset external reset exit stop mode by interrupt cpu clk source stop fosce wait osc (osc on) out 1 no wait osc (osc off) out 0 (1) wait in 1 wait wait in (2) 0 (2) wait wait xosc (osc on) out 1 no wait xosc (osc off) out 0 wait in 1 wait no wait in 0 wait no wait (1) this case has no meaning for applications. (2) this case never occurs.
july 7, 1997 general release specification mc68HC05PD6 clock distribution motorola rev 1.1 8-5 figure 8-2. time base clock divider 8.4.1 lcdclk the clocks divided by 64 and 128 are used as lcd clock at the lcd driver module, and clocks are selected by the lclk bit in the tbcr1. 8.4.2 stup time base divider is initialized to $0078 by the power on detection and when the count reaches 8072, stup ?g in the misc register is set. once stup ?g is set, it is never cleared until power down. 8.4.3 watchdog timer (cop) the computer operating properly watchdog timer (cop) is controlled by the cope bit in the tbcr2 register. s e l 7 bit divider s e l s e l divide by 4 tbclk lclk 7 bit divider rtr1 rtr0 cop enable cop clear cop reset lcd clock 1/2 6 1/2 7 1/2 0 1/2 5 1/2 6 1/2 7 xclk osc/2 7 0 1 0 1
general release specification july 7, 1997 motorola clock distribution mc68HC05PD6 8-6 rev 1.1 the cop uses the clock that is selected by the rtr1 and rtr0 bits. cop time- out reset will be generated if the cop enable (cope) bit is set. the cop time-out reset has the same vector address as por and external reset. to prevent the cop time-out the cop divider is cleared by writing a ? to bit 0 of address $fff0. when the time base divider is driven by the osc clock, clock for the divider is suspended during stop mode or when fosce is 0. this may cause cop period stretching or no cop time-out reset when processing errors occur. it is recommended that xosc clock to be used for the cop functions to avoid these problems. when the time base (cop) divider is driven by the xosc clock, the divider does not stop counting and writing a ? to bit 0 of address $fff0 must be triggered to prevent the cop time-out. 8.4.4 time base control register 1 (tbcr1) tbclk ?time base clock the tbclk bit selects time base clock source. this bit is cleared on reset. after reset, write to this bit is allowed only once. 0 = xosc clock is selected 1 = osc clock divide-by 128 is selected lclk ?lcd clock the lclk bit selects clock for the lcd driver. this bit is cleared on reset. 0 = divide by 64 is selected 1 = divide by 128 is selected table 8-3. cop time out period rtr1 rtr0 cop period (ms) osc=4mhz osc=4.1943mhz xosc=76.8khz min max min max min max 0 1 12.3 16.4 11.7 15.6 10 13.33 0 1 393 524 375 500 320 426.67 1 0 786 1048 750 1000 640 853.33 1 1 1573 2097 1500 2000 1280 1706.66 w r tbcr1 $0010 reset t tbclk 0 7 00 54 0 0000 6 3210 0 0 lclk 0 0 t2r0 t2r1
july 7, 1997 general release specification mc68HC05PD6 clock distribution motorola rev 1.1 8-7 t2r1/0 ?timer 2 prescale rate select bits t2r1 and t2r0 select timer 2 clock rate. see section 9 for a detailed description. 8.4.5 time base control register 2 (tbcr2) rti1/0 ?real time interrupt rate select the rtr1 and rtr0 bits select one of four rates for the real time interrupt period. the rti rate is related to the cop time-out reset period. these bits are set to 1 on reset. cope ?cop enable when the cope bit is 1, cop reset function is enabled. this bit is cleared on reset (including cop time-out reset) and write to this bit is allowed only once after rest. 8.5 real time clock (rtc) real time clock is software programmable which can be either enabled or disabled. real time clock consists of three binary counters which are divided down from the 76.8khz oscillator. there are three bits in the rtc status register (address $39) and three bits in the rtc control register (address $3a) where the operation of the real time clock is controlled. 8.5.1 rtc time registers three locations are reserved for real time clock operation; they are: rt1 rt0 divide ratio osc=4mhz osc=4.1943mhz xosc=76.8khz 0 0 tbclk ? 128 244hz 256hz 600hz 0 1 tbclk ? 4096 7.63hz 8hz 18.75hz 1 0 tbclk ? 8192 3.81hz 4hz 9.38hz 1 1 tbclk ? 16384 1.91hz 2hz 4.69hz w r tbcr2 $0011 reset t 0 0 7 11 54 x 0000 6 3210 0 rtr0 rtr1 0 0 0 cope
general release specification july 7, 1997 motorola clock distribution mc68HC05PD6 8-8 rev 1.1 the hours and minutes registers are in fact holding registers (see figure 8-3 ). when setting the rtc time, the hours and minutes are written ?st, then writing to the seconds register will cause the hours and minutes in their holding registers to be latched into the rtc hardware. when reading the rtc time, the seconds register is ?st accessed; this will cause the hardware to latch the hours and minutes into their respective holding registers. now, reading the hours and minutes registers will give the time for the moment when the seconds register was read. figure 8-3. rtc holding register w r reset t 0 0 7 00 54 0 0000 6 3210 0 hour4 0 hour3 hour2 hour0 hour1 hour $0033 w r reset t 0 0 7 00 54 0 0000 6 3210 0 min4 min5 min3 min2 min0 min1 min $0034 w r reset t 0 0 7 00 54 0 0000 6 3210 0 sec4 sec5 sec3 sec2 sec0 sec1 sec $0035 hours minutes ($34) seconds ($35) hours ($33) minutes cpu core holding registers rtc hardware registers
july 7, 1997 general release specification mc68HC05PD6 clock distribution motorola rev 1.1 8-9 8.5.2 rtc alarm registers there are three locations associated with the alarm registers as shown. the alf bit in the rtc status register is set when the contents of the rtc alarm registers matches the contents of the rtc time registers. 8.5.3 rtc status register there are three interrupts associated with the rtc, their ?gs are in the rtc status register ($39), and their respective enable bits are the rtc control register ($3a). rtcf when this bit is set, real time clock interrupts cpu once a day. after serving this interrupt, it is the users responsibility to clear this bit, otherwise the cpu will keep on serving this once a day interrupt when a new rtc interrupt occurs (even there is no once a day interrupt occurs). this bit is cleared by writing a 1 to it. w r reset t 0 0 7 00 54 0 0000 6 3210 0 houra4 0 houra3 houra2 houra0 houra1 houra $0036 w r reset t 0 0 7 00 54 0 0000 6 3210 0 mina4 mina5 mina3 mina2 mina0 mina1 mina $0037 w r reset t 0 0 7 00 54 0 0000 6 3210 0 seca4 seca5 seca3 seca2 seca0 seca1 seca $0038 w r reset t 0 0 7 00 54 0 0000 6 3210 0 0 0 0 secf rtcf alf rtcs $0039
general release specification july 7, 1997 motorola clock distribution mc68HC05PD6 8-10 rev 1.1 alf when this bit is set, alarm interrupt has occurred. after serving this interrupt, it is the users responsibility to clear this bit, otherwise the cpu will keep on serving this alarm interrupt when a new rtc interrupt occurs (even there is no alarm interrupt occurs). this bit is cleared by writing a 1 to it. secf when this bit is set, real time clock interrupts cpu once a second. after serving this interrupt, it is the users responsibility to clear this bit, otherwise the cpu will keep on serving this once a second interrupt when a new rtc interrupt occurs (even there is no once a second interrupt occurs). this bit is cleared by writing a 1 to it. 8.5.4 rtc control register there are three interrupts associated with the rtc, their ?gs are in the rtc status register ($39), and their respective enable bits are the rtc control register ($3a). rtce 1 = real time clock once a day interrupt enabled 0 = real time clock once a day interrupt disabled ale 1 = alarm interrupt enabled 0 = alarm interrupt disabled sece 1 = real time clock once a second interrupt enabled 0 = real time clock once a second interrupt disabled it should be noted that the ?gs in the interrupt status register will be set if the corresponding event is detected, irrespective of the setting of the interrupt enable bits. following is an example showing how to use the rtc interrupt: w r reset t 0 0 7 00 54 0 0000 6 3210 0 0 0 0 sece rtce ale rtcc $003a
july 7, 1997 general release specification mc68HC05PD6 clock distribution motorola rev 1.1 8-11 *main program bset0,$3aenable rtc (once a day) interrupt. bset 1,$3a enable rtc (alarm) interrupt. bset 2,$3a enable rtc (once a second) interrupt. stop mcu execute stop instruction for power conservation. *real time clock interrupt service routine brset 0,$39,oday this bit is set indicating this is an once a day rtc interrupt. brset 1,$39,alint this bit is set indicating this is a rtc interrupt caused by a match of alarm registers and real time clock registers. brset 2,$39,osec this bit is set indicating this is an once a second rtc interrupt. oday bset 0,$39 clear this bit so that this once a day interrupt will not be recognized as a new one on next rtc interrupt. jsr oaday once a day interrupt service routine. brset 1,$39,alint this bit is set indicating alarm interrupt also occurs at the same time. brset 2,$39,osec this bit is set indicating once a second rtc interrupt also occurs at the same time. rtcr rti alint bset 1,$39 clear this bit so that this alarm interrupt will not be recognized as a new one on next rtc interrupt. jsr alarm alarm service interrupt routine. brset 2,$39,osec this bit is set indicating once a second interrupt also occurs at the same time. bra rtcr return from interrupt. osec bset 2,$39 clear this bit so that this once a second interrupt will not be recognized as a new one on next rtc interrupt. jsr oasec once a second interrupt service routine. bra rtcr return from interrupt. 8.6 miscellaneous register (misc) ftup ?osc time up flag power on detection or clearing fosce bit clears this bit. this bit is set by the over?w of the por counter. an external reset does not affect this bit. 0 = during por or osc shut down 1 = osc clock is available for the system clock w r misc $003e reset t ftup x 7 00 54 x 1010 6 3210 stup 0 0 sys1 sys0 optm fosce
general release specification july 7, 1997 motorola clock distribution mc68HC05PD6 8-12 rev 1.1 stup ?xosc time up flag the power on detection clears this bit. this bit is set after the time base has counted 8072 clocks. an reset does not affect this bit. 0 = xosc is not stabilized or no signal on xosc1-xosc2 pins 1 = xosc clock is available for the system clock sys1, sys0 ?system clock select these two bits select the system clock source for all internal modules except time base. on reset the sys1 and sys0 bits are initialized to 1 and 0, respectively. fosce - fast (main) oscillator enable the fosce bit controls the main oscillator activity. this bit should not be cleared by the cpu when the main oscillator is selected as the system clock source. 0 = osc is shut down; 7 bit divider at the osc input and por counter are initialized to $0078; ftup ?g is cleared. 1 = main oscillator starts again; ftup ?g is set by the por counter over?w (8072 clocks). optm - option map select the optm bit selects one of two register maps at $0000-$003f. this bit is cleared on reset. 0 = main register map is selected 1 = option map is selected sys1 sys0 divide ratio osc=4mhz osc=4.1943mhz xosc=76.8khz 0 0 osc ? 2 2mhz 2.0972mhz 0 1 osc ? 4 1mhz 1.0486mhz 1 0 osc ? 64 62.5khz 65.536khz 1 1 xosc ? 4 19.2khz
july 7, 1997 general release specification mc68HC05PD6 timer system motorola rev 1.1 9-1 section 9 timer system the mc68HC05PD6 has two timer modules, timer 1 with a 16 bit counter and timer 2 with an 8 bit counter. timer 1 has tcap input pin and tcmp output pin. timer 2 has evi input pin and evo output pin. the following block diagram describes the timer system of mc68HC05PD6. figure 9-1. timer system block diagram 9.1 timer1 the timer consists of a 16-bit free-running counter driven by a ?ed divide-by-four prescaler. this timer can be used for many purposes, including input waveform measurements while simultaneously generating an output waveform. pulse widths can vary from several microseconds to many seconds. refer to figure 9-2 for timer 1 block diagram. tcap input control1 timer1 timer2 evi input control2 prescaler timer registers output control evo s e l cap clk1 exclk clk2 iedg t2clk ovf1 cmp1 cmp2 ph2 (16 bit counter) (8 bit counter) output control tcmp oe1 ol2 oe2 il2 im2
general release specification july 7, 1997 motorola timer system mc68HC05PD6 9-2 rev 1.1 because the timer has a 16-bit architecture, each speci? functional segment (capability) is represented by two registers. these registers contain the high and low byte of that functional segment. generally, accessing the low byte of a speci? timer function allows full control of that function; however, an access of the high byte inhibits that speci? timer function until the low byte is also accessed. note the i bit in the ccr should be set while manipulating both the high and low byte register of a speci? timer function to ensure that an interrupt does not occur. 9.1.1 counter the key element in the programmable timer is a 16-bit, free-running counter or counter register, preceded by a prescaler that divides the internal processor clock by four. the prescaler gives the timer a resolution of 2 microseconds if the internal bus clock is 2.0 mhz. the counter is incremented during the low portion of the internal bus clock. software can read the counter at any time without affecting its value. the double-byte, free-running counter can be read from either of two locations, $18-$19 (counter register) or $1a-$1b (counter alternate register). a read from only the least signi?ant byte (lsb) of the free-running counter ($19, $1b) receives the count value at the time of the read. if a read of the free-running counter or counter alternate register ?st addresses the most signi?ant byte (msb) ($18, $1a), the lsb ($19, $1b) is transferred to a buffer. this buffer value remains ?ed after the ?st msb read, even if the user reads the msb several times. this buffer is accessed when reading the free-running counter or counter alternate register lsb ($19 or $1b) and, thus, completes a read sequence of the total counter value. in reading either the free-running counter or counter alternate register, if the msb is read, the lsb must also be read to complete the sequence. the counter alternate register differs from the counter register in one respect: a read of the counter register lsb can clear the timer over?w ?g (tof). therefore, the counter alternate register can be read at any time without the possibility of missing timer over?w interrupts due to clearing of the tof.
july 7, 1997 general release specification mc68HC05PD6 timer system motorola rev 1.1 9-3 figure 9-2. timer 1 block diagram mc68hc05 internal bus interrupt circuit internal timer clock (ntf1) oc1f tof icf oc1ie olvl iedg icie toie ? 4 8-bit buffer 16-bit free running counters input capture register output compare register alternate counter register output compare circuit overflow detect circuit edge detect circuit interrupt logic tcr tsr reset tcmp tcap high byte low byte $12 $13 $14 $15 $16 $17 $18 $19 $1a $1b d ck q
general release specification july 7, 1997 motorola timer system mc68HC05PD6 9-4 rev 1.1 figure 9-3. timer state timing diagram for reset figure 9-4. timer state timing diagram for timer over?w $fffc $fffd $fffe $ffff internal processor clock internal reset t00 t01 t10 t11 counter (16 bit) reset (external, lvr or por) internal timer clocks note: the counter register and timer control register are the only ones affected by reset $fffe $0000 $0001 $0002 internal processor clock t00 t01 t10 t11 counter (16 bit) timer overflow flag (tof) internal timer clocks note: the tof bit is set at timer state t11 (transition of counter from $ffff to $0000). it is cleared by read of the timer status register during the internal processor clock high time followed by a read of the counter low register. $ffff
july 7, 1997 general release specification mc68HC05PD6 timer system motorola rev 1.1 9-5 the free-running counter is con?ured to $fffc during reset and is always a read-only register. during a power-on reset, the counter is also preset to $fffc and begins running after the oscillator start-up delay. because the free-running counter is 16 bits preceded by a ?ed divide-by-four prescaler, the value in the free-running counter repeats every 262,144 internal bus clock cycles. when the counter rolls over from $ffff to $0000, the tof bit is set. an interrupt can also be enabled when counter roll over occurs by setting its interrupt enable bit (toie). 1 7 1111111 6543210 w r cnth $0018 reset cnt15 cnt14 cnt13 cnt12 cnt11 cnt10 cnt9 cnt8 1 7 1111100 6543210 w r cntl $0019 reset cnt7 cnt6 cnt5 cnt4 cnt3 cnt2 cnt1 cnt0 1 7 1111111 6543210 w r acnth $001a reset acnt15 acnt14 acnt13 acnt12 acnt11 acnt10 acnt9 acnt8 1 7 1111100 6543210 w r acntl $001b reset acnt7 acnt6 acnt5 acnt4 acnt3 acnt2 acnt1 acnt0
general release specification july 7, 1997 motorola timer system mc68HC05PD6 9-6 rev 1.1 9.1.2 output compare register the 16-bit output compare register is made up of two 8-bit registers at locations $16 (msb) and $17 (lsb). the output compare register is used for several purposes, such as indicating when a period of time has elapsed. all bits are readable and writable and are not altered by the timer hardware or reset. if the compare function is not needed, the two bytes of the output compare register can be used as storage locations. the output compare register contents are compared with the contents of the free- running counter continually, and if a match is found, the corresponding output compare ?g (oc1f) bit is set and the corresponding output level (olvl) bit is clocked to an output level register. the output compare register values and the output level bit should be changed after each successful comparison to establish a new elapsed time-out. an interrupt can also accompany a successful output compare provided the corresponding interrupt enable bit (ocie) is set. after a processor write cycle to the output compare register containing the msb ($16), the output compare function is inhibited until the lsb ($17) is also written. the user must write both bytes (locations) if the msb is written ?st. a write made only to the lsb ($17) will not inhibit the compare function. the free-running counter is updated every four internal bus clock cycles. the minimum time required to update the output compare register is a function of the program rather than the internal hardware. the processor can write to either byte of the output compare register without affecting the other byte. the output level (olvl) bit is clocked to the output level register regardless of whether the output compare ?g (oc1f) is set or clear. x 7 xxxxxxx 6543210 w r o cmph $0016 reset oc15 oc14 oc13 oc12 oc11 oc10 oc9 oc8 x 7 xxxxxxx 6543210 w r ocmpl $0017 reset oc7 oc6 oc5 oc4 oc3 oc2 oc1 oc0
july 7, 1997 general release specification mc68HC05PD6 timer system motorola rev 1.1 9-7 figure 9-5. timer state timing diagram for output compare $ffeb $ffed $ffee $ffef internal processor clock t00 t01 t10 t11 counter(16 bit) output compare flag (oc1f) internal timer clocks 1. the cpu writes to the compare register may take place at any time, but a compare only occurs at timer state t01. thus, a 4- cycle different may exist between the write to the compare register and the actual compare. 2. internal compare takes place during timer state t01. 3. oc1f is set at timer state t11 which follows the comparison match ($ffed in this example). $ffec compare register compare register latch 1 2 3 cpu writes $ffed $ffed
general release specification july 7, 1997 motorola timer system mc68HC05PD6 9-8 rev 1.1 9.1.3 input capture register two 8-bit registers, which make up the 16-bit input capture register, are read-only and are used to latch the value of the free-running counter after the corresponding input capture edge detector senses a de?ed transition. the level transition which triggers the counter transfer is de?ed by the corresponding input edge bit (iedg). reset does not affect the contents of the input capture register. the result obtained by an input capture will be one more than the value of the free-running counter on the rising edge of the internal bus clock preceding the external transition. this delay is required for internal synchronization. resolution is one count of the free-running counter, which is four internal bus clock cycles. the free-running counter contents are transferred to the input capture register on each proper signal transition regardless of whether the input capture ?g (icf) is set or clear. the input capture register always contains the free-running counter value that corresponds to the most recent input capture. after a read of the input capture register ($14) msb, the counter transfer is inhibited until the lsb ($15) is also read. this characteristic causes the time used in the input capture software routine and its interaction with the main program to determine the minimum pulse period. a read of the input capture register lsb ($15) does not inhibit the free-running counter transfer since they occur on opposite edges of the internal bus clock. note since the tcap pin is shared with the pc3 i/o pin, changing the state of the pc3 ddr or data register can cause an unwanted tcap interrupt. this can be handled by clearing the icie bit before changing the con?uration of pc3, and clearing any pending interrupts before enabling icie. x 7 xxxxxxx 6543210 w r icaph $0014 reset ic15 ic14 ic13 ic12 ic11 ic10 ic9 ic8 x 7 xxxxxxx 6543210 w r icapl $0015 reset ic7 ic6 ic5 ic4 ic3 ic2 ic1 ic0
july 7, 1997 general release specification mc68HC05PD6 timer system motorola rev 1.1 9-9 figure 9-6. timer state timing diagram for input capture $ffeb $ffed $ffee $ffef internal processor clock t00 t01 t10 t11 counter(16 bit) input capture flag (icf) internal timer clocks note: if the input edge occurs in the shaded area from one timer state t10 to the other timer state t10 the input capture flag is set during the next state t11. $ffec capture register internal capture latch $???? $ffed note input edge
general release specification july 7, 1997 motorola timer system mc68HC05PD6 9-10 rev 1.1 9.1.4 timer control register (tcr) the tcr is a read/write register containing six control bits. three bits control interrupts associated with each of the three ?g bits found in the timer status register. the other two bits control: 1) which edge is signi?ant to the input capture edge detector (i.e., negative or positive), and 2) the next value to be clocked to the output level register in response to a successful output compare. the timer control register and the free running counter are the only sections of the timer affected by reset. the tcmp pin is forced low during external reset and stays low until a valid compare changes it to high. the timer control register is illustrated below by a de?ition of each bit. icie if the input capture interrupt enable (icie) bit is set, a timer interrupt is enable when the icf status ?g is set, provided the i bit in ccr is cleared. if the icie bit is cleared, the interrupt is inhibited. the icie bit is cleared by reset. oc1ie if the output compare interrupt enable (oc1ie) bit is set, a timer interrupt is enabled whenever the oc1f status ?g is set, provided the i bit in ccr is cleared. if the oc1ie bit is cleared, the interrupt is inhibited. the oc1ie bit is cleared by reset. toie if the timer over?w interrupt enable (toie) bit is set, a timer interrupt is enabled whenever the tof status ?g is set, provided the i bit in ccr is cleared. if the toie bit is cleared, the interrupt is inhibited. the toie bit is cleared by reset. oe1 the oe1 bit con?ures whether port c bit 2 as i/o pin or as output pin of tcmp. 0 = pc2 is selected 1 = tcmp is selected iedg the value of the input edge (iedg) bit determines which level transition on tcap pin will trigger a free running counter transfer to the input capture register. reset does not affect the iedg bit. 0 = negative edge 1 = positive edge 0 icie 0 7 iedg 00000x0 6543210 oe1 0 olvl w r tcr $0012 reset toie oc1ie
july 7, 1997 general release specification mc68HC05PD6 timer system motorola rev 1.1 9-11 olvl the value of the output level (olvl) bit is clocked into the output level register by the next successful output compare and will appear at tcmp pin. this bit and the output level register are cleared by reset. 0 = low output 1 = high output 9.1.5 timer status register (tsr) the timer status register is a read-only register and is illustrated below followed by a de?ition of each bit. refer to timing diagrams shown in figure 9-3 , figure 9-4 and figure 9-5 for timing relationship to the timer status register bits. icf the input capture ?g (icf) is set when a proper edge has been sensed by the input capture edge detector. it is cleared by a processor access of the timer status register (with icf set) followed by accessing the low byte ($15) of the input capture register. reset does not affect the input compare ?g. oc1f the output compare ?g (oc1f) is set when the output compare register contents matches the contents of the free running counter. the oc1f is cleared by accessing the timer status register (with oc1f set) and then accessing the low byte ($17) of the output compare register. reset does not affect the output compare ?g. tof the timer over?w ?g (tof) bit is set by transition of the free run from $ffff to $0000. it is cleared by accessing the timer status register (with tof set) followed by an access of the free running counter least signi?ant byte ($19). reset does not affect the tof bit. accessing the timer status register satis?s the ?st condition required to clear status bits. the remaining step is to access the register corresponding to the status bit. a problem can occur when using the timer over?w function and reading the free- running counter at random times to measure an elapsed time. without incorporating the proper precautions into software, the timer over?w ?g could x 7 xx00000 6543210 0 0 0 0 0 tof oc1f icf w r tsr $0013 reset
general release specification july 7, 1997 motorola timer system mc68HC05PD6 9-12 rev 1.1 unintentionally be cleared if: 1)the timer status register is read or written when tof is set, and 2)the lsb of the free-running counter is read but not for the purpose of servicing the ?g. the counter alternate register at address $1a and $1b contains the same value as the free-running counter (at address $18 and $19); therefore, this alternate register can be read at any time without affecting the timer over?w ?g in the timer status register. 9.1.6 operation during low power mode during stop and wait instructions, the programmable timer 1 functions as follows: during the wait mode, the timer 1 continues to operate normally and may generate an interrupt to trigger the cpu out of the wait state; during the stop mode, the timer 1 holds at its current state, retaining all data, and resumes operation from this point when external interrupt (irq), or internal interrupt is received. 9.2 timer 2 timer 2 is an 8-bit event counter which has one compare register, one event input pin (evi), and one event output pin (evo). the event counter is clocked by the external clock (exclk) or prescaled system clock (clk2), selected by the t2clk bit in the tcr2 register. the exclk may be evi direct or evi gated by clk2, which is selected by the im2 bit at the evi block (refer to the evi description). timer 2 may be used as a modulus clock divider with evo pin, free running counter (when compare register is $00), or periodic interrupt timer. the timer counter 2 (cnt2) is an 8-bit up counter with preset input. the counter is preset to $01 by a cmp2 signal from the comparator or by a cpu write to it that is done while the system clock (ph2) is low. the clk2 from the prescaler or the extclk from the evi block are selected as timer clock by the t2clk bit in the tcr2 register. the clk2 and the exclk are synchronized to the falling edge of system clock in the prescaler and the evi blocks. the minimum pulse width of clk2 is the same as the system clock, and the minimum pulse width of exclk (event mode) is one ph2 cycle.
july 7, 1997 general release specification mc68HC05PD6 timer system motorola rev 1.1 9-13 figure 9-7. timer 2 block diagram the counter is incremented by the falling edge of the timer clock and the period between two falling edges is de?ed as one timer cycle in the following description. the compare register (oc2) is provided for comparison with the timer counter 2 (cnt2). the oc2 data is transferred to the buffer register when the counter is preset by a cpu write or by a compare output (cmp2). this buffer register is compared with the timer counter 2 (cnt2). the comparison between the counter and the oc2 buffer register is done when the system clock high in each bus cycles. if counter matches with the oc2 buffer register, the comparator latches this result during the current timer cycle. when the next timer cycle begins, the comparator outputs cmp2 signal (if the compare match is detected during previous timer cycle). this cmp2 is used in the counter preset, data transfer to the buffer register, setting oc2f in the tsr2, and the evo block. the counter preset overrides the counter increment. the oc2f bit may generate interrupt request if the oc2ie bit in the tcr2 is set. counter 2 comparator 2 register (oc2) buffer 2 s e l (transfer) (transfer) ($01) ($01) 0 1 counter write clk2 exclk t2clk cmp2
general release specification july 7, 1997 motorola timer system mc68HC05PD6 9-14 rev 1.1 figure 9-8. timer 2 timing diagram for f(ph2) > f(timclk) n n 01 counter2 ph2 timclk oc2 (buffer) cmp2 evo compare preset oc2=2,3,4,...,ff,0 01 01 01 counter2 ph2 timclk oc2 (buffer) cmp2 evo (count up) (count up) (count up) compare preset oc2=1 preset preset (count up) (count up) (count up)
july 7, 1997 general release specification mc68HC05PD6 timer system motorola rev 1.1 9-15 figure 9-9. timer 2 timing diagram for f(ph2) = f(timclk) n-1 n 02 counter2 ph2 timclk oc2 (buffer) cmp2 evo 3 oc2=2,3,4,...,ff,0 oc2=1 1. count up 2. compare 3. preset (that overrides count up) 1. count up 2. compare 3. preset (that overrides count up) n01 (1) 1 11 22 2 2 01 01 01 counter2 ph2 timclk oc2 (buffer) cmp2 evo 3 01 01 (1) (1) (1) (1) 22 2 2 3 3 3
general release specification july 7, 1997 motorola timer system mc68HC05PD6 9-16 rev 1.1 9.2.1 timer control register 2 (tcr2) ti2ie ?timer input 2 interrupt enable ti2ie bit enables timer input 2 (evi) interrupt when ti2f is set. this bit is cleared on reset. 0 = timer input 2 interrupt is disabled 1 = timer input 2 interrupt is enabled oc2ie ?compare 2 interrupt enable oc2ie bit enables compare 2 (cmp2) interrupt when compare match is detected (oc2f is set). this bit is cleared on reset. 0 = compare 2 interrupt is disabled 1 = compare 2 interrupt is enabled t2clk ?timer 2 clock select the t2clk bit selects clock source for the timer counter 2. this bit is cleared on reset. 0 = clk2 from prescaler is selected 1 = exclk from evi input block is selected im2 ?timer input 2 mode select the im2 bit selects whether evi input is gated by clk2 or not gated by clk2. this bit is cleared on reset. 0 = evi is not gated by clk2 (event mode) 1 = evi is gated by clk2 (gated mode) il2 ?timer input 2 active edge (level) select the il2 bit selects the active edge of evi to increment counter for the event mode (im2 = 0), or gate enable level of evi for the gate mode (im2 = 1). this bit is cleared on reset. 0 = falling edge is selected (event mode) low level enables counting (gate mode) 1 = rising edge is selected (event mode) high level enables counting (gated mode) im2 il2 action on clock 0 0 evi falling edge increments counter 0 1 evi rising edge increments counter 1 0 low level on evi enables counting 1 1 high level on evi enables counting w r tcr2 $0001c reset t ti2ie 0 7 00 54 0 0000 6 3210 oc2ie t2clk 0 im2 il2 ol2 oe2
july 7, 1997 general release specification mc68HC05PD6 timer system motorola rev 1.1 9-17 oe2 ?timer output 2 (evo) output enable the oe2 bit enables evo output on pc5 pin. when this bit is changed, control of the pin is delayed (synchronized) until the next active edge of evo that is selected by ol2 bit occurs. this bit is cleared on reset. 0 = evo output is disabled 1 = evo output is enabled ol2 ?timer output 2 edge select for synchronization the ol2 bit selects which edge of evo clock should be synchronized by the oe2 bit control. the ol2 bit also decides the initial value of the cmp2 divider, when counter 2 is written to by the cpu. this bit is cleared on reset. 0 = the falling edge of evo switches evo output and pc5 if oe2 bit has been changed 1 = the rising edge of evo switches evo output and pc5 if oe2 bit has been changed 9.2.2 timer status register 2 (tsr2) ti2f ?timer input 2 (evi) interrupt flag in event mode the event edge sets ti2f and in gated time accumulation mode the trailing edge of the gate signal at the evi input pin sets ti2f. when ti2ie bit and this bit are set, an interrupt is generated. this bit is a read only bit and writes have no effect. the ti2f is cleared by writing a 1 to the rti2f bit and on reset. oc2f ?compare 2 interrupt flag the oc2f bit is set when the compare match is detected between counter 2 and oc2 register. when oc2ie bit and this bit are set, an interrupt is generated. this bit is a read only bit and writes have no effect. the oc2f is cleared by writing a 1 to roc2f bit and on reset. rti2f ?reset timer input 2 flag the rti2f bit is a write only bit and always read as 0. writing 1 to this bit clears ti2f bit and writing a 0 to this bit has no effect. roc2f ?reset output compare 2 flag the roc2f bit is a write only bit and always read as 0. writing 1 to this bit clears oc2f bit and writing a 0 to this bit has no effect. w r tsr2 $001d reset t ti2f 0 7 00 54 0 0000 6 3210 oc2f 0 0 rti2f roc2f 0 0 0 0
general release specification july 7, 1997 motorola timer system mc68HC05PD6 9-18 rev 1.1 9.2.3 output compare register 2 (oc2) the oc2 register data is transferred to the buffer register when the cpu writes to cnt2, when the cmp2 presets the cnt2, or when system reset. when the oc2 buffer register matches the cnt2 register, the oc2f bit in the tsr2 register is set and cnt2 is preset to $01. 9.2.4 timer counter 2 (cnt2) the timer counter 2 (cnt2) is incremented by the falling edge of the timer clock (which is synchronized and has the same timing as falling edge of ph2). the cnt2 register is compared with oc2 buffer register and initialized to $01 if it matches. it is also initialized to $01 on reset and any cpu write to this register. the cpu read of this counter should be done while ph2 is high and data may be latched by the local or main data bus while ph2 is low. 9.2.5 time base control register 1 (tbcr1) tbclk, lclk see section 8.4 for a detailed description. w r oc2 $001e reset t 2oc7 1 7 11 54 1 1111 6 3210 2oc6 2oc4 2oc5 2oc3 2oc2 2oc0 2oc1 w r cnt2 $001f reset t 2cnt7 0 7 00 54 0 0001 6 3210 2cnt6 2cnt4 2cnt5 2cnt3 2cnt2 2cnt0 2cnt1 counter preset to 1 w r tbcr1 $0010 reset t tbclk 0 7 00 54 0 0000 6 3210 0 0 lclk 0 0 t2r0 t2r1
july 7, 1997 general release specification mc68HC05PD6 timer system motorola rev 1.1 9-19 t2r1, t2r0 ?prescale rate select bits for timer 2 the t2r1 and t2r0 bits select prescale rate of clk2 for timer 2. these bits are cleared on reset. 9.2.6 timer input 2 (evi) the event input (evi) is used as an external clock input for timer 2. figure 9-10. evi block diagram since the external clock may be asynchronous to the internal clock, this input has a synchronizer which samples external clock by the internal system clock. (the input transition synchronizes to the falling edge of ph2. therefore the minimum pulse width for evi must be larger than one system clock to be measured.) the im2 and il2 bits in the tcr2 determine how this synchronized external clock is used. im2 bit decides between event mode and gated mode, and il2 bit decides which level or edge is activated. in the event mode (im2 = 0), the external clock drives the timer 2 counter directly and the active edge at the evi pin is selected by the il2 bit. when active edge is detected the ti2f bit in the tcr2 is set. in the gated mode (im2 = 1), the evi input is gated by clk2 from the prescaler and gate output drives the timer 2 counter. il2 bit decides active level of the external input. when the transition from active level to inactive level is detected the ti2f bit is set. t2r1 t2r0 system clock divide by 00 1 01 4 10 32 1 1 256 pc4 evi sync active edge/level selector gate/event mode control pc4 ph2 il2 im2 clk2 to ti2f exclk
general release specification july 7, 1997 motorola timer system mc68HC05PD6 9-20 rev 1.1 changing the im2 bit may cause an illegal count up of cnt2. thus presetting cnt2 after initializing im2 is required. note since the evi pin is shared with the pc4 i/o pin, ddrc4 should always be cleared whenever evi is used. evi should not be used when ddrc4 is high. table 9-1. evi mode select im2 il2 action on clock 0 0 evi falling edge increments counter 0 1 evi rising edge increments counter 1 0 low level on evi enables counting 1 1 high level on evi enables counting
july 7, 1997 general release specification mc68HC05PD6 timer system motorola rev 1.1 9-21 figure 9-11. evi timing diagram 9.2.7 event output (evo) the evo pin is the clock output pin of timer 2. the compare output from the timer 2 (cmp2) is divided in this block for 50% duty output signal. this 1/2 divider is initialized to the level of the ol2 bit when the timer counter 2 is written to by the cpu (initialized). x+1 x+2 counter ph2 exclk (il2=0) im2=0 (event mode) evi x x+1 x+2 counter exclk (il2=1) x counter clk2 exclk (il2=0) im2=1 (gate mode) evi synchronized counter exclk (il2=1)
general release specification july 7, 1997 motorola timer system mc68HC05PD6 9-22 rev 1.1 figure 9-12. evo block diagram when the oe2 bit in the timer control register 2 (tcr2) is set, the evo output is activated and when oe2 is cleared evo is deactivated. these controls must be done synchronously to the evo output signal to avoid an incomplete pulse on the pin. the ol2 bit in the tcr2 decides which edge of evo should be synchronized. when ddrc5 bit is set or the synchronized output enable is high (clock on), the output buffer at the evo/pc5 pin is enabled. if ddrc5 bit is set to one, the pin state during the idling condition (clock off) depends on the pc5 output data latch. if ddrc5 is cleared, the pin becomes high impedance during clock off. 1/2 d c q sel pc5 evo oe2 ol2 cmp2 cntr2 write pc5 (out) pc5 (in) ddrc5 1 0
july 7, 1997 general release specification mc68HC05PD6 timer system motorola rev 1.1 9-23 figure 9-13. evo timing diagram 9.3 prescaler the 8-bit prescaler in the timer system divides system clock (ph2) and provides divided clock to each timer and event input. clk1 for the timer 1 is a ?ed frequency clock (ph2/4). clk2 for the timer 2 is selected by t2r1 and t2r0 bits in the tbcr1, and this clock is also used as the event input for the gate mode. the clk2 transitions must be synchronous to the falling edge of ph2. pc5=0/evo oe2 cmp2/2 ol2 = 0 cmp2 evo pc5=1/evo oe2 cmp2/2 ol2 = 1 cmp2 evo cntr2 write
general release specification july 7, 1997 motorola timer system mc68HC05PD6 9-24 rev 1.1 figure 9-14. prescaler block diagram table 9-2. clk2 divide ratio t2r1 t2r0 system clock divide by 00 1 01 4 10 32 1 1 256 8-bit divider sel 1111 1 4 32 256 t2r1 t2r0 clk2 for timer 2 clk1 for timer 1 1 4 rst ph2
july 7, 1997 general release specification mc68HC05PD6 lcd driver motorola rev 1.1 10-1 section 10 lcd driver the lcd driver may be con?ured with 4 backplanes (bp) and 36 frontplanes (fp) maximum. the vdd voltage is the highest level of the output waveform and the lower three levels are vlcd1, vlcd2, and vlcd3. vlcd3 can be externally driven, while vlcd1 and vlcd2 are internally generated. on reset, lcd enable bit (lcde) in the lcd control register (lcdcr) is cleared (lcd drivers at a disabled state) and all bp and fp pins output vdd level. the lcd clock is generated by the time base module and lclk bit in the tbcr1 selects clock frequency. 10.1 lcd waveform examples the following ?ures illustrate the lcd timing examples.
general release specification july 7, 1997 motorola lcd driver mc68HC05PD6 10-2 rev 1.1 figure 10-1. lcd 1/3 duty and 1/3 bias timing diagram 1frame duty=1/3 bias=1/3 (vlcd1=(vdd-vlcd3)2/3+vlcd3, vlcd2=(vdd-vlcd3)/3+vlcd3) bp0 fpx (x010) vdd vlcd1 vlcd3 vdd vlcd2 vlcd3 vdd vlcd1 vlcd2 vlcd3 vdd vlcd1 bp1-fpx (on) +2vlcd/3 +vlcd/3 -vlcd/3 -2vlcd/3 -vdd +vdd +2vlcd/3 +vlcd/3 0 -vlcd/3 vlcd2 vlcd1 vlcd2 vlcd3 +vdd 0 -2vlcd/3 -vdd bp1 bp0-fpx (off) bp2
july 7, 1997 general release specification mc68HC05PD6 lcd driver motorola rev 1.1 10-3 figure 10-2. lcd 1/4 duty and 1/4 bias timing diagram 1frame duty=1/4 bias=1/3 (vlcd1=(vdd-vlcd3)2/3+vlcd3, vlcd2=(vdd-vlcd3)/3+vlcd3) bp0 fpx (1001) vdd vlcd1 vlcd3 vdd vlcd2 vlcd3 vdd vlcd1 vlcd2 vlcd3 vdd vlcd1 vlcd1 vlcd2 +vdd +2vlcd/3 +vlcd/3 0 -vlcd/3 -2vlcd/3 -vdd +vlcd/3 vlcd2 vlcd1 vlcd2 vlcd3 vdd vlcd3 0 -vlcd/3 bp1 bp1-fpx (off) bp2 +vdd +2vlcd/3 -2vlcd/3 -vdd bp3 bp0-fpx (on)
general release specification july 7, 1997 motorola lcd driver mc68HC05PD6 10-4 rev 1.1 10.2 vlcd3 bias input & bias resistors vlcd3 is the bias input for the mc68hc(7)05pd6 lcd module. the highest level of the output waveform is vdd voltage and the lower three levels are vlcd1, vlcd2 and vlcd3. vlcd3 is externally driven, while the other reference voltages, vlcd1 and vlcd2, are internally generated. the mc68hc(7)05pd6 lcd module has software selectable internal bias resistors r lcd1, r lcd2 and r lcd3 which form a resistor ladder. this ladder is used to generate vlcd1, vlcd2 and vlcd3. the resistors are arranged such that vdd>vlcd1>vlcd2>vlcd3. bias voltages may be adjusted using these internal resistors. three possible values may be selected for these resistors using the fc and lc bits in the lcd control register at $0020. a contrast resistor, r v , as illustrated in figure 10-3 , may be placed between vdd and vss. figure 10-3. simpli?d lcd voltage divider schematic vdd vlcd3 r lcd1 r lcd2 r lcd3 vdd vlcd1 vlcd2 vlcd3 r v mcu
july 7, 1997 general release specification mc68HC05PD6 lcd driver motorola rev 1.1 10-5 10.3 backplane driver and port selection the number of backplanes (port d) pins depends on the lcd duty. it is automatically selected by duty1 and duty0 bits in the lcd control register (lcdcr). on reset, these bits are cleared and 1/4 duty is selected. 10.4 lcd control register (lcdcr) lcde ?lcd output enable the lcde bit enables all bp and fp outputs. this bit is cleared on reset. 0 = ports that con?ure as bp and fp pins will output vdd. 1 = all bp and fp pins output lcd waveform dutys ?lcd duty select the dutys bits select the duty of lcd driver as shown in table 10-1 . the number of bp pins is related to this duty selection. the unused bp pin is used as port d pin. default duty is 1/4 duty. these bits are cleared on reset. dutyof ?lcd duty disable 0 = lcd duty is enable. the number of bp pins is determined by dutys. 1 = lcd duty is disable. bp0 - bp3 are replaced by pd0 - pd3 respectively regardless the selection of lcd duty. fc, lc ?fast charge, low current these bits are used to select resistor values in the voltage generator resistor chain. reset clears these bits. table 10-1. backplanes and port selection duty lcd control pin selection dutys bp3/pd3 bp2/pd2 bp1/pd1 bp0/pd0 1/3 1 pd3 bp2 bp1 bp0 1/4 0 bp3 bp2 bp1 bp0 0 7 0000000 6543210 w r lcdcr $0020 reset lcde 0 dutys dutyof 0 0 fc lc
general release specification july 7, 1997 motorola lcd driver mc68HC05PD6 10-6 rev 1.1 10.5 lcd data register (lcdr x ) data in the lcdr x (lcdr1-lcdr18) controls the waveform of the two frontplanes drivers. bit 0 thru 3 and bit 4 thru 7 of this register decide the waveforms at the bp0 thru bp3 timings. if lcd duty is not 1/4, the register bit for the unused backplanes have no meaning. 0 = output deselect waveform at the corresponding backplanes timing. 1 = output select waveform at the corresponding backplanes timing. table 10-2. lcd bias resistors lc fc action 0 x default value of typically 30k w per resistor 1 0 resistor value of typically 200k w per resistor 11 fast-charge: for period of lcd clk/128 in each frame the resis- tor values are reduced to default (value for lc=0) duty frontplane data register bit usage 76543210 1/3 bp2 bp1 bp0 bp2 bp1 bp0 1/4 bp3 bp2 bp1 bp0 bp3 bp2 bp1 bp0 x 7 xxxxxxx 6543210 w r lcdr x $0021- $0032 reset bp3 bp2 bp1 bp0 bp3 bp2 bp1 bp0 fp(2 x -1) fp(2 x -2)
july 7, 1997 general release specification mc68HC05PD6 serial communications interface motorola rev 1.1 11-1 section 11 serial communications interface a full-duplex asynchronous sci is provided with a standard nrz format and a selection of baud rates. the sci transmitter and receiver are functionally independent but use the same data format and baud rate. the terms baud and bit rate are used synonymously in the following description. 11.1 sci two-wire system features standard nrz (mark/space) format advanced error detection method includes noise detection for noise duration of up to 1/16 bit time full-duplex operation (simultaneous transmit and receive) software programmable for different baud rates software-selectable word length (eight or nine bit words) separate transmitter and receiver enable bits sci may be interrupt driven four separate interrupt conditions 11.2 sci receiver features receiver wake-up function (idle or address bit) idle line detect framing error detect noise detect overrun detect receiver data register full ?g 11.3 sci transmitter features transmit data register empty ?g transmit complete ?g break send
general release specification july 7, 1997 motorola serial communications interface mc68HC05PD6 11-2 rev 1.1 any sci two-wire system requires receive data in (rdi) and transmit data out (tdo). figure 11-1. serial communications interface block diagram sci interrupt internal bus transmit data register transmit data shift register receive data shift register receive data register tie tcie rie ilie te re rwu sbk fe nf or idle rdrf tc tdre transmit control flag control receive control wake up unit rate generator scp1 scp0 scr2 scr1 scr0 r8 t8 m wake sccr1 baud rate register internal processor clock 7 td0 rdi see note see note note: the serial data communications data register (scdat) is controlled by the r / w signal. it is the transmit data register when written and receive data register when read. sccr2 scsr te sbk
july 7, 1997 general release specification mc68HC05PD6 serial communications interface motorola rev 1.1 11-3 11.4 data format receive data in (rdi) or transmit data out (tdo) is the serial data presented between the internal data bus and the output pin (tdo) and between the input pin (rdi) and the internal data bus. data format is as shown for the nrz in figure 11-2 and must meet the following criteria: 1. a high level indicates a logic one and a low level indicates a logic zero. 2. the idle line is in a high (logic one) state prior to transmission/reception of a message. 3. a start bit (logic zero) is transmitted/received indicating the start of a message. 4. the data is transmitted and received least-signi?ant-bit ?st. 5. a stop bit (high in the tenth or eleventh bit position) indicates the byte is complete. 6. a break is de?ed as the transmission or reception of a low (logic zero) for some multiple of the data format. 11.5 wake-up feature in a typical multiprocessor con?uration, the software protocol will usually identify the addressee(s) at the beginning of the message. to permit uninterested mpus to ignore the remainder of the message, a wake-up feature is included, whereby all further sci receiver ?g (and interrupt) processing can be inhibited until its data line returns to the idle state. an sci receiver is re-enabled by an idle string of at least ten (or eleven) consecutive ones. software for the transmitter must provide for the required idle string between consecutive messages and prevent it from occurring within messages. a second wake-up method is available in which sleeping sci receivers can be awakened by a logic one in the high-order bit of a received character. figure 11-2. data format 0123456 8 idle line 0 7 * start stop start control bit m selects 8 or 9 bit data * stop bit is always high
general release specification july 7, 1997 motorola serial communications interface mc68HC05PD6 11-4 rev 1.1 11.6 receive data in (rdi) receive data in (rdi) is the serial data which is presented from the input pin via the sci to the receive data register (rdr). while waiting for a start bit, the receiver samples the input at a rate 16 times higher than the set baud rate. this increased rate is referred to as the rt rate. when the input (idle) line is detected low, it is tested for three more sample times. if at least two of these three samples detect a logic low, a valid start bit is assumed to be detected. if in two or more samples, a logic high is detected, the line is assumed to be idle. the receive clock generator is controlled by the baud rate register (see section 11.9.5 ); however, the sci is synchronized by the start bit independent of the transmitter. once a valid start bit is detected, the start bit, each data bit, and the stop bit are each sampled three times. the value of the bit is determined by voting logic, which takes the value of a majority of samples. a noise ?g is set when all three samples on a valid start bit, data bit, or stop bit do not agree. a noise ?g is also set when the start veri?ation samples do not agree. 11.7 start bit detection following a framing error if there has been a framing error (fe) without detection of a break (10 zeros for 8- bit format or 11 zeros for a 9-bit format), the circuit continues to operate as if there actually were a stop bit, and the start edge will be placed arti?ially. the last bit received in the data shift register is inverted to a logic one, and the three logic-one start quali?rs (shown in figure 11-4 ) are forced into the sample shift register during the interval when detection of a start bit is anticipated (see figure 11-5 ); therefore, the start bit will be accepted no sooner than it is anticipated. if the receiver detects that a break (rdrf=1, fe=1, receiver data register=$00) produced the framing error, the start bit will not be arti?ially induced, and the receiver must actually receive a logic one before start. see figure 11-6 . figure 11-3. sampling technique used on all bits rdi previous bit present bit samples next bit vvv 8 r t 10 r t 9 r t 16 r t 1 r t 1 r t 16 r t
july 7, 1997 general release specification mc68HC05PD6 serial communications interface motorola rev 1.1 11-5 figure 11-4. example of start-bit sampling technique figure 11-5. sci arti?ial start following a framing error figure 11-6. sci start following a break 16x internal sampling clock rt clock edges (for all three examples) 12345678 r t r t r t r tt r t r t r t r 1 1 11111111 start 0000 start quali?rs start edge veri?ation samples idle 1 1 11111111 start 0010 idle noise 1 1 11011111 start 0010 idle noise rdi1 rdi2 rdi3 receive data in data expected stop arti?ial edge data samples data (a) case 1: receive line low during arti?ial edge receive data in data expected stop start edge data samples data (b) case 2: receive line high during start edge start bit start bit start bit data start quali?rs samples data samples data samples start edge veri?ation samples detected as valid start edge break expected stop receive data in
general release specification july 7, 1997 motorola serial communications interface mc68HC05PD6 11-6 rev 1.1 11.8 transmit data out (tdo) transmit data out is the serial data which is presented from the internal data bus via the sci and then to the output pin. data format is as discussed above and shown in figure 11-2 . the transmitter generates a bit time by using a derivative of the rt clock, thus producing a transmission rate equal to 1/16 that of the receiver sample clock. 11.9 sci registers there are ?e registers used in the sci; the internal con?uration of these registers is discussed in the following paragraphs. a block diagram of the sci system is shown in figure 11-1 . 11.9.1 serial communications data register (scdat) the serial communications data register performs two functions in the serial communications interface; i.e. it acts as the receive data register when it is read and as the transmit data register when it is written. figure 11-1 shows this register as two separate registers, namely: the receive data register (rdr) and the transmit data register (tdr). as shown in figure 11-1 , the tdr (transmit data register) provides the parallel interface from the internal data bus to the transmit shift register and the receive data register (rdr) provides the interface from the receive shift register to the internal data bus. when scdat is read, it becomes the receive data register and contains the last byte of data received. the receive data register, represented above, is a read-only register containing the last byte of data received from the shift register for the internal data bus. the rdrf bit (receive data register full bit in the serial communications status register) is set to indicate that a byte has been transferred from the input serial shift register to the serial communications data register. the transfer is synchronized with the receiver bit rate clock (from the receive control) as shown in figure 11-1 . all data is received least-signi?ant-bit ?st. when scdat is written, it becomes the transmit data register and contains the next byte of data to be transmitted. the transmit data register, also represented above, is a write-only register containing the next byte of data to be applied to the x 7 xxxxxxx 6543210 w r scdr $000e reset scd7 scd6 scd5 scd4 scd3 scd2 scd1 scd0
july 7, 1997 general release specification mc68HC05PD6 serial communications interface motorola rev 1.1 11-7 transmit shift register from the internal data bus. as long as the transmitter is enabled, data stored in the serial communications data register is transferred to the transmit shift register (after the current byte in the shift register has been transmitted). the transfer from the scdat to the transmit shift register is synchronized with the bit rate clock (from the transmit control) as shown in figure 11-1 . all data is transmitted least-signi?ant-bit ?st. 11.9.2 serial communications control register 1 (sccr1) the serial communications control register 1 (sccr1) provides the control bits which: 1) determine the word length (either 8 or 9 bits), and 2) selects the method used for the wake-up feature. bits 6 and 7 provide a location for storing the ninth bit for longer bytes. r8 if the m bit is a one, then this bit provides a storage location for the ninth bit in the receive data byte. reset does not affect this bit. t8 if the m bit is a one, then this bit provides a storage location for the ninth bit in the transmit data byte. reset does not affect this bit. m the option of the word length is selected by the con?uration of this bit and is shown below. reset does not affect this bit. 0 = 1 start bit, 8 data bits, 1 stop bit 1 = 1 start bit, 9 data bits, 1 stop bit wake this bit allows the user to select the method for receive ?ake up? if the wake bit is a logic zero, an idle line condition will ?ake up the receiver. if the wake bit is set to a logic one, the system acknowledges an address bit (most signi?ant bit). the address bit is dependent on both the wake bit and the m bit level (table shown below). (additionally, the receiver does not use the wake- up feature unless the rwu control bit in serial communications control register 2 is set as discussed below.) reset does not affect this bit. x 7 x-xx- - - 6543210 w r sccr1 $000b reset r8 t8 m wake
general release specification july 7, 1997 motorola serial communications interface mc68HC05PD6 11-8 rev 1.1 11.9.3 serial communications control register 2 (sccr2) the serial communications control register 2 (sccr2) provides the control bits which: individually enable/disable the transmitter or receiver, enable the system interrupts, and provide the wake-up enable bit and a ?end break code bit. each of these bits is described below. (the individual ?gs are discussed in the section 11.9.4 .) tie when the transmit interrupt enable bit is set, the sci interrupt occurs provided tdre is set (see figure 11-1 ). when tie is cleared, the tdre interrupt is disabled. reset clears the tie bit. tcie when the transmission complete interrupt enable bit is set, the sci interrupt occurs provided tc is set (see figure 11-1 ). when tcie is clear, the tc interrupt is disabled. reset clears the tcie bit. rie when the receive interrupt enable bit is set, the sci interrupt occurs provided or is set or rdrf is set (see figure 11-1 ). when rie is cleared, the or and rdrf interrupts are disabled. reset clears the rie bit. ilie when the idle line interrupt enable bit is set, the sci interrupt occurs provided idle is set (see figure 11-1 ). when ilie is cleared, the idle interrupt is disabled. reset clears the ilie bit. wake m method of receiver ?akeup 0x detection of an idle line allows the next data byte received to cause the receive data register to fill and produce an rdrf. 10 detection of a received one in the eight data bit allows an rdrf flag and associated error flags. 11 detection of a received one in the ninth data bit allows an rdrf flag and associated error flag. 0 7 0000000 6543210 w r sccr2 $000c reset tie tcie rie ilie te re rwu sbk
july 7, 1997 general release specification mc68HC05PD6 serial communications interface motorola rev 1.1 11-9 te when the transmit enable bit is set, the transmit shift register output is applied to the tdo line. depending on the state of control bit m in serial communications control register 1, a preamble of 10 (m=0) or 11 (m=1) consecutive ones is transmitted when software sets the te bit from a cleared state. if a transmission is in progress, and te is written to a zero, then the transmitter will wait until after the present byte has been transmitted before placing the tdo pin in the idle high-impedance state. if the te bit has been written to a zero and then set to a one before the current byte is transmitted, the transmitter will wait until that byte is transmitted and will then initiate transmission of a new preamble. after the preamble is transmitted, and provided the tdre bit is set (no new data to transmit), the line remains idle (driven high while te = 1); otherwise, normal transmission occurs. this function allows the user to ?eatly terminate a transmission sequence. after loading the last byte in the serial communications data register and receiving the interrupt from tdre, indicating the data has been transferred into the shift register, the user should clear te. the last byte will then be transmitted and the line will go idle (high impedance). reset clears the te bit. re when the receive enable bit is set, the receiver is enabled. when re is cleared, the receiver is disabled and all of the status bits associated with the receiver (rdrf, idle, or, nf, and fe) are inhibited. reset clears the re bit. rwu when the receiver wake-up bit is set, it enables the ?ake up function. the type of ?ake up mode for the receiver is determined by the wake bit discussed above (in the sccr1). when the rwu bit is set, no status ?gs will be set. flags which were set previously will not be cleared with rwu is set. if the wake bit is cleared, rwu is cleared after receiving 10 (m=0) or 11 (m=1) consecutive ones. under these conditions, rwu cannot be set if the line is idle. if the wake bit is set, rwu is cleared after receiving an address bit. the rdrf ?g will then be set and the address byte will be stored in the receiver data register. reset clears the rwu bit. sbk when the send break bit is set the transmitter sends zeros in some number equal to a multiple of the data format bits. if the sbk bit is toggled set and clear, the transmitter sends 10 (m=0) or 11 (m=1) zeros and then reverts to idle or sending data. the actual number of zeros sent when sbk is toggled depends on the data format set by the m bit in the serial communications control register 1; therefore, the break code will be synchronous with respect to the data stream. at the completion of the break code, the transmitter sends at least one high bit to guarantee recognition of a valid start bit. reset clears the sbk bit.
general release specification july 7, 1997 motorola serial communications interface mc68HC05PD6 11-10 rev 1.1 11.9.4 serial communications status register (scsr) the serial communications status register (scsr) provides inputs to the interrupt logic circuits for generation of the sci system interrupt. in addition, a noise ?g bit and a framing error bit are also contained in the scsr. tdre the transmit data register empty bit is set to indicate that the contents of the serial communications data register have been transferred to the transmit serial shift register. if the tdre bit is clear, it indicates that the transfer has not yet occurred and a write to the serial communications data register will overwrite the previous value. the tdre bit is cleared by accessing the serial communications status register (with tdre set), followed by writing to the serial communications data register. data can not be transmitted unless the serial communications status register is accessed before writing to the serial communications data register to clear the tdre ?g bit. reset sets the tdre bit. tc the transmit complete bit is set at the end of a data frame, preamble, or break condition if: 1. te = 1, tdre = 1, and no pending data, preamble, or break is to be transmitted; or 2. te = 0, and the data, preamble, or break (in the transmit shift register) has been transmitted. the tc bit is a status ?g which indicates that one of the above conditions has occurred. the tc bit is cleared by accessing the serial communications status register (with tc set), followed by writing to the serial communications data register. it does not inhibit the transmitter function in any way. reset sets the tc bit. rdrf when the receive data register full bit is set, it indicates that the receiver serial shift register is transferred to the serial communications data register. if multiple errors are detected in any one received word, the nf, fe, and rdrf bits will be affected as appropriate during the same clock cycle. the rdrf bit is cleared when the serial communications status register is accessed (with rdrf set) followed by a read of the serial communications data register. reset clears the rdrf bit. 1 7 100000 - 6543210 w r scsr $000d reset tdre tc rdrf idle or nf fe
july 7, 1997 general release specification mc68HC05PD6 serial communications interface motorola rev 1.1 11-11 idle when the idle line detect bit is set, it indicates that a receiver idle line is detected (receipt of a minimum number of ones to constitute the number of bits in the byte format). the minimum number of ones needed will be 10 (m=0) or 11 (m=1). this allows a receiver that is not in the wake-up mode to detect the end of a message, detect the preamble of a new message, or to resynchronize with the transmitter. the idle bit is cleared by accessing the serial communications status register (with idle set) followed by a read of the serial communications data register. the idle bit will not be set again until after an rdrf has been set; i.e., a new idle line occurs. the idle is not set by an idle line when the receiver ?akes up from the wake-up mode. reset clears the idle bit. or when the overrun error bit is set, it indicates that the next byte is ready to be transferred from the receive shift register to the serial communications data register when it is already full (rdrf it is set). data transfer is then inhibited until the rdrf bit is cleared. data in the serial communications data register is valid in this case, but additional data received during an overrun condition (including the byte causing overrun) will be lost. the or bit is cleared when the serial communications status register is accessed (with or set), followed by a read of the serial communications data register. reset clears the or bit. nf the noise ?g bit is set if there is noise on a ?alid start bit or if there is noise on any of the data bits or if there is noise on the stop bit. it is not set by noise on the idle line nor by invalid (false) start bits. if there is noise, the nf bit is not set until the rdrf ?g is set. each data bit is sampled three times as described above in receive data in and shown in fig. 5-3. the nf bit represents the status of the byte in the serial communications data register. for the byte being received (shifted in) there will also be a ?orking noise ?g the value of which will be transferred to the nf bit when the serial data is loaded into the serial communications data register. the nf bit does not generate an interrupt because the rdrf bit gets set with nf and can be used to generate the interrupt. the nf bit is cleared when the serial communications status register is accessed (with nf set), followed by a read of the serial communications data register. reset clears the nf bit. fe the framing error bit is set when the byte boundaries in the bit stream are not synchronized with the receiver bit counter (generated by a ?ost stop bit). the byte is transferred to the serial communications data register and the rdrf bit is set. the fe bit does not generate an interrupt because the rdrf bit is set at the same time as fe and can be used to generate the interrupt. note that if the byte received causes a framing error and it will also cause an overrun if transferred to the serial communications data register, then the overrun bit will
general release specification july 7, 1997 motorola serial communications interface mc68HC05PD6 11-12 rev 1.1 be set, but not the framing error bit, and the byte will not be transferred to the serial communications data register. the fe bit is cleared when the serial communications status register is accessed (with fe set) followed by a read of the serial communications data register. reset clears the fe bit. 11.9.5 baud rate register the baud rate register provides the means for selecting different baud rates which may be used as the rate control for the transmitter and receiver. the scp0-scp1 bits function as a prescaler for the scr0-scr2 bits. together, these ?e bits provide multiple, baud rate combinations for a given internal processor clock frequency. scp0, scp1 these two bits in the baud rate register are used as a prescaler to increase the range of standard baud rates controlled by the scr0-scr2 bits. a table of the prescaler internal processor clock division versus bit levels is provided below. reset clears scp1-scp0 bit (divide-by-one). scr2, scr1, scr0 these three bits in the baud rate register are used to select the baud rates of both the transmitter and receiver. a table of baud rates versus bit levels is shown below. reset does not affect the scr2-scr0 bits. the diagram of figure 11-7 and table 11-1 and table 11-2 illustrate the divided chain used to obtain the baud rate clock (transmit clock). note that there is a ?ed rate divide-by-16 between the receive clock (rt) and the transmit clock (tx). the actual divider chain is controlled by the combined scp0-scp1 and scr0-scr2 bits in the baud rate register as illustrated. all divided frequencies shown in the ?st table represent the ?al transmit clock (the actual baud rate) resulting from the internal processor clock division shown in the ?ivide-by column only scp1 scp0 internal processor clock divide by 00 1 01 3 10 4 11 13 0 7 0000uuu 6543210 w r scbrr $000a reset scp1 scp0 scr2 scr1 scr0 0 0 0
july 7, 1997 general release specification mc68HC05PD6 serial communications interface motorola rev 1.1 11-13 (prescaler division only). the second table illustrates how the prescaler output can be further divided by action of the sci select bits (scr0-scr2). for example, assume that a 9600 hz baud rate is required with a 4 mhz oscillator frequency. in this case the prescaler bits (scp0-scp1) could be con?ured as a divide-by- thirteen. if a divide-by-thirteen prescaler is used, then the scr0-scr2 bits must be con?ured as a divide-by-one. this results in a divide-by-one of the internal processor clock to produce a 9600 hz baud rate clock. figure 11-7. rate generator division scr2 scr1 scr0 prescaler output divide by 000 1 001 2 010 4 011 8 100 16 101 32 110 64 111 128 table 11-1. prescaler highest baud rate frequency output scp1 scp0 clock* divided by system clock (sclk) 2m 1m 62.5k 38.4 0 0 1 125 khz 62.5khz 3906 hz 2400 hz 0 1 3 41.666 khz 20.833 khz 1302 hz 800 hz 1 0 4 31.250 khz 15.625 khz 977 hz 600 hz 1 1 13 9600 hz 4800 hz 300 hz 185 hz * this clock is the system clock (sclk) shown in figure 11-7 . div 2, 4 or 64 sci receive clock (rt) osc scp0, scp1 prescaler control n scr0, scr1, scr2 sci select rate control m div 2 xosc sel sys1 sys0 div 16 sci transmit clock (tx) sclk
general release specification july 7, 1997 motorola serial communications interface mc68HC05PD6 11-14 rev 1.1 note the divided frequencies shown in table 11-1 represent baud rates which are the highest transmit baud rate (tx) that can be obtained by a speci? clock frequency and only using the prescaler division. lower baud rate may be obtained by providing a further division using the sci rate select bits as shown below for some representative prescaler outputs table 11-2. transmit baud rate output for a given prescaler output note table 11-2 illustrates how the sci select bits can be used to provide lower transmitter baud rates by further dividing the prescaler output frequency. the four examples are only representative samples. in all cases, the baud rates shown are transmit baud rates (transmit clock) and the receiver clock is 16 times higher in frequency than the actual baud rate. scr2 scr1 scr0 divided by representative highest prescaler baud rate ouput 125.000 khz 39.06 khz 15.625 khz 9.600khz 0 0 0 1 125.000 khz 39.06 khz 15.625khz 9600hz 0 0 1 2 62.5 khz 19.53 khz 7.813 khz 4800hz 0 1 0 4 31.250 khz 9.765 khz 3.906 khz 2400hz 0 1 1 8 15.625 khz 4.883 khz 1.953 khz 1200hz 1 0 0 16 7.813 khz 2.441 khz 977hz 600hz 1 0 1 32 3.906 khz 1.221 khz 488 hz 300hz 1 1 0 64 1.953 khz 610 hz 244 hz 150hz 1 1 1 128 977 hz 305 hz 122 hz 75hz
july 7, 1997 general release specification mc68HC05PD6 p-decoder motorola rev 1.1 12-1 section 12 p-decoder the p-decoder is fully compatible with ccir radiopaging code number 1 (recommendation 584). the architecture allows for ?xible application in a wide variety of radiopager designs. it can receive messages containing tone, numeric and character data at 512bps, 1200bps and 2400bps data speed. 12.1 p-decoder features fully compatible with ccir radiopaging code no.1 programmable data rates: 512, 1200 and 2400 bps (bits per second) software programmable data polarity up to 6 user addresses capacity two independent frame addresses battery saving operation programmable battery saving time up to 2 bits error correction ability in both address and message codewords with 10-bit bch (bose-chaudhuri-hocquenghem) codes 12.2 ccir radiopaging code no.1 the transmission of data using ccir radiopaging code no.1 is shown in figure 12-1 . it consists of a preamble followed by batches of complete codewords, each batch commencing with a synchronization codeword (sc). transmission may cease at the end of a batch when there are no further calls. 12.2.1 preamble each transmission starts with a preamble to help the pagers attain bit synchronization and thus help in acquiring word and batch synchronization. the preamble is a pattern of bit reversals, 10101... repeated for a period of at least 576 bits, i.e. the duration of a batch plus a codeword.
general release specification july 7, 1997 motorola p-decoder mc68HC05PD6 12-2 rev 1.1 12.2.2 batch structure codewords are structured in batches which comprise a synchronization codeword followed by 8 frames with each frame containing 2 codewords. the frames are numbered 0 to 7 and the pager population is divided into 8 groups. thus each pager is allocated to one of the 8 frames according to the 3 least signi?ant bits (lsb) of its 21 bit identity, i.e. 000 = frame 0, 111 = frame 7, and only examines address codewords in that frame. therefore each pagers address codewords must only be transmitted in the frame that is allocated to it. message codewords for any pager may be transmitted in any frame but will follow, directly, the associated address codeword. a message may consist of any number of codewords transmitted consecutively and may span one or more batches. figure 12-1. ccir radiopaging code no.1 format preamble first batch second and subsequent bat c sc: synchronization codeword during at least 576 bits = 1 batch + 1 codeword bit reversals 10101,etc. sc 1 frame = 2 codewords 18 address bits 2 function bits 10 bch check bits p 0 address codeword 20 message bits 10 bch check bits p 1 message codeword
july 7, 1997 general release specification mc68HC05PD6 p-decoder motorola rev 1.1 12-3 12.2.3 codeword a frame consists of two codewords, each 32 bits long. a codeword is either an address, a message or an idle codeword. idle codewords are transmitted to ?l empty batches or to separate messages. an address codeword always starts with a ?? it has 18 bits of the 21 bit user address (bit 2 to 19) which is protected against transmission errors by 10 bits of bch check bits (bit 22 to 31). the missing three bits of user address are coded in the frame number in the batch, in which the address codeword is transmitted. two function bits (bit 20 and 21) allow for distinguishing one of the four different calls to the same user address. the ?al bit (bit 32) is chosen to give even parity. a message codeword always starts with a ? and the whole message always directly follows the address codeword. in a message codeword, 20 bits of any display information can be put into the message bits (bit 2 to 21). 12.3 functional blocks the p-decoder consists of a clock divider, power saving generator, check bits decoder and corrector, preamble and synchronization code detector. the functional block is shown in figure 12-2 .
general release specification july 7, 1997 motorola p-decoder mc68HC05PD6 12-4 rev 1.1 figure 12-2. p-decoder block diagram scf msgf adrf dbf dcf 32-bit shift register data input clock generator clock 76.8khz bch corrector preamble & sc detector mode generator frame state generator power saving generator address comparator adr a ~ adr f rair $26 rmir x $27 ~ $29 errf flag control msgie adrie dbie dcie pll fb fa ds interrupt bs1 bs2 bs3 dpol pdsr $10 pdcr1 $11
july 7, 1997 general release specification mc68HC05PD6 p-decoder motorola rev 1.1 12-5 12.3.1 clock generator 76.8khz clock signal feeds this clock generator. it generates the internal system clock according to the ds1 and ds0 bits in the pdcr1 register. 12.3.2 bch corrector each codeword has 21 information bits, which correspond to the coef?ients of a polynomial having the terms from x 30 down to x 10 . this polynomial is divided, modulo-2, by the generating polynomial x 10 +x 9 +x 8 +x 6 +x 5 +x 3 +x 1 . the check bits correspond to the coef?ients of the terms from x 9 to x 0 in the remainder polynomial found at the completion of this division. the complete block, consisting of the information bits followed by the check bits, corresponds to the coef?ients of a polynomial which is integrally divisible in modulo-2 fashion by the generating polynomial. figure 12-3 shows the ?wchart of the bch error detection and correction. the bch has the ability of correcting up to 2 bits error. the errf ?g in the pdsr register shows the error status. if errf = ?? there are 2 or less than 2 bits error and the data in the rmir register is valid. if errf = ?? there are more than 2 bits error and the data in the rmir register is invalid. figure 12-3. bch decoder flow chart start s1 = 0 error function s(x) = 0 n = 21 n = n+1 no no yes no yes receiving correct digit yes syndrom generation s3 = 0 no coefficient calculation n = 1 yes
general release specification july 7, 1997 motorola p-decoder mc68HC05PD6 12-6 rev 1.1 12.3.3 address comparator the address comparator checks whether the incoming address codeword is addressed to itself according to the fa2-fa0, fb2-fb0 of the p-decoder control register and the six user addresses. both 32-bit codewords in the self-frame will be received and will be compared to the six user addresses stored in adr a -adr f . if the 1st 32 bits of received data is not the same as any of the six addresses, the 2nd 32 bits of received data in the same frame will also be compared. if the 1st or the 2nd codeword does match, the index of the matched user address out of the six user addresses and the 2 function bits in the received address codeword are stored in the rair register, subsequent multiple 20 bits of error-corrected message codewords are also stored in rmir registers. 12.3.4 battery saving generator this block generates the battery saving signals that minimize the battery consumption. figure 12-5 shows the timing of the battery saving signals in waiting mode and figure 12-7 shows the timing in receiving mode. 12.3.4.1 bs1 it controls the main rf circuit on/off. if bs1 is high, the power of rf circuit should be turned on. if bs1 is low, the power of rf circuit should be turned off. 12.3.4.2 bs2 it is used to discharge the capacitor of the rf circuit. it changes to high simultaneously when bs1 changes to high and then changes to low after a certain time interval. this signal is active high. 12.3.4.3 bs3 it controls the on/off of the pll circuit. pll circuit should be turned on before the rf circuit is turned on. the time which bs3 is activated before bs1 can be set by the pll1 and pll0 bit in pdcr1 register. bs3 goes low when bs1 goes low . pll1 pll0 bs3 activate time before bs1 0 0 0 ms 0 1 9.76 ms 1 0 33.3 ms 1 1 62.5 ms
july 7, 1997 general release specification mc68HC05PD6 p-decoder motorola rev 1.1 12-7 12.3.5 mode generator there are four kinds of operating modes in the p-decoder as shown in figure 12-4 : programming, waiting, preamble and receiving mode. figure 12-4. mode transition diagram 12.3.6 programming mode the p-decoder is in programming mode when the progc bit in the pdcr1 is not set. pdcr1, pdcr2 and the six user address registers should be de?ed before the progc bit is set. after progc is set, the p-decoder enter the waiting mode and the contents of pdcr1, pdcr2 and the six user address registers can no longer be modi?d until progc bit is cleared again. 12.3.7 waiting mode the operating mode changes to waiting mode from preamble mode after the progc bit is set. in the waiting mode, the three battery saving signals toggle periodically. figure 12-5 shows the timing relationship. when bs1 = 1 and bs2 = 0, the p-decoder synchronizes the incoming data from rf circuit to the rising edge of bit clock and checks 6 bits of the preamble pattern. if there is a preamble pattern, it will enter the preamble mode. otherwise, it will stay in the waiting mode. after the operating mode changes from the receiving mode to the waiting mode, the p-decoder will synchronize to the position of the synchronization code (sc). within t b1o interval, it receives 32 bits of data to check whether it is the sc. if it is the sc, it will enter the receiving mode again. otherwise, it will stay in the waiting mode. programming waiting preamble receiving sc_det=0 progc=1 sc_det=0 sc_det=1 sc_det=1 pr_det=1 pr_det=1
general release specification july 7, 1997 motorola p-decoder mc68HC05PD6 12-8 rev 1.1 figure 12-5. battery saving signals in waiting mode note pll = 11 is valid only in hc05pd6 device. writing 11 to pll should be avoided when using a hc705pd6 device. table 12-1. timing of battery saving signals characteristic typ (ms) t bsp 512 bps 1062.5 1200 bps 453.3 2400 bps 226.6 t b1o 512 bps 80.08 1200 bps 42.5 2400 bps 26.6 t b2o 512 bps 17.58 1200 bps 15.83 2400 bps 13.3 t b3p pll=00 0 pll=01 9.76 pll=10 33.3 pll=11 62.5 bs1 bs2 bs3 t bsp t bsp t bsp t b1o t b2o t b3p
july 7, 1997 general release specification mc68HC05PD6 p-decoder motorola rev 1.1 12-9 12.3.7.1 preamble mode after receiving the preamble pattern, it enters preamble mode and continues to check the following 544 bits of data. if there is an sc inside the 544-bit time frame, it will change to the receiving mode. otherwise, it will change to the waiting mode. the bs1 and bs3 signals hold at ? and the bs2 signal holds at ? for the whole preamble mode duration. 12.3.7.2 receiving mode the receiving mode starts with the frame 0 when the sc is detected in the preamble mode. the battery saving signals, bs1, bs2 and bs3, will be changed according to ds1-ds0, fa2-fa0, fb2-fb0, pll1-pll0 of the p-decoder control registers. the 32 bits of data in the self-frame number will be received and compared to the six user addresses stored in adr a -adr f . if the 1st 32 bits of received data is not the same as one of the six addresses, the 2nd 32 bits of received data in the same frame will also be compared. if it does not match, the battery saving signals will hold at ?? if the 1st or the 2nd codeword does match, the dbf ?g in the pdsr register is set. after the address information and 2 function bits are stored in the rair register, adrf ?g in pdsr register will be set. the p-decoder will keep bs1 = ?? bs2 = ?? bs3 = ? to receive the message data. when 20 bits of message data are stored in the rmir registers, the msgf ?g is set. the receiving of message data will be terminated when it meets other address codeword or the idle codeword and the dcf ?g in pdsr register will be set. in the receiving mode, it continues to detect the sc. if it does not detect the sc, the scf ?g in pdsr will be cleared. if the sc is absent consecutively for 2 times, the operating mode will be changed to the waiting mode. the scf ?g in pdsr register will be set when the sc is detected and cleared when the sc is not detected. the errf ?g in pdsr shows the validity of the 20-bit message data. in most situation, if errf = ?? there is 2 or less than 2 bits error and the data in the rmir register is valid. if errf = ?? there is more than 2 bits error and the data in the rmir register is invalid. message codewords following this error codeword will be ignored. figure 12-6 and figure 12-7 show the timing of signals in the receiving mode. 12.3.8 frame state generator in each batch, there are one sc and sixteen codewords. state 16 is assigned to sc, state 0 is assigned to the 1st codeword and state 15 is assigned to the 16th codeword sequentially. it provides the information to generate the battery saving signals. 12.3.9 preamble and synchronization codeword detector it is used to detect the preamble pattern and synchronization codeword.
general release specification july 7, 1997 motorola p-decoder mc68HC05PD6 12-10 rev 1.1 12.4 registers there are several registers associated with the p-decoder as described below. 12.4.1 p-decoder control register 1 (pdcr1) pden ?p-decoder enable if the pden bit is set, the p-decoder module is enabled, if pden is cleared, the module is reset and disabled. progc ?programming completed if the progc bit is set, the p-decoder system is enabled. this bit must be cleared before the 6 user addresses and bits in pdcr2 and pdcr3 have been set. once progc is set, user cannot change the data contents in pdcr2, pdcr3 and the 6 user address registers. dcie ?data received complete interrupt enable when the dcie is set, interrupt occurs when all the data is received completely provided the dcf in the status register is set and the i-bit in the condition code register is cleared. if dcie is cleared, this interrupt is disabled. dbie ?data receiving begin interrupt enable when the dbie is set, interrupt occurs when it begins to receive data into the address and message registers provided the dbf in the status register is set and the i-bit in the condition code register is cleared. if dbie is cleared, this interrupt is disabled. msgie ?message received interrupt enable when the msgie is set, interrupt occurs when 20 bits of message has been stored in the received message information registers provided the msgf in the status register is set and the i-bit in the condition code register is cleared. if msgie is cleared, this interrupt is disabled. adrie ?address received interrupt enable when the adrie is set, interrupt occurs when 3 bits of address and 2 function bits has been stored in the received address information register provided the adrf in the status register is set and the i-bit in the condition code register is cleared. if adrie is cleared, this interrupt is disabled. w r pdcr1 $0011 reset t pden 0 7 00 54 0 0000 6 3210 0 dcie dbie msgie adrie 0 progc option map
july 7, 1997 general release specification mc68HC05PD6 p-decoder motorola rev 1.1 12-11 12.4.2 p-decoder control register 2 (pdcr2) fb specify the frame number that the 6 user de?ed addresses belong to. 12.4.3 p-decoder control register 3 (pdcr3) pll1, pll0 these 2 bits decide the time that bs3 goes high before bs1. when the data speed is con?ured to 512 bps or 1200 bps, bs3 timing looks like the table shown in table 12-1 . when the data speed is con?ured to 2400 bps, bs3 timing is shown in the following table. table 12-2. frame number de?ition fa / fb frame number 000 0 001 1 010 2 011 3 100 4 101 5 110 6 111 7 w r pdcr2 $0012 reset t 0 0 7 00 54 0 0000 6 3210 fb2 0 0 0 0 fb1 fb0 option map w r pdcr3 $0013 reset t pll1 0 7 00 54 0 0000 6 3210 pll0 dpol fa2 fa1 fa0 ds1 ds0 option map
general release specification july 7, 1997 motorola p-decoder mc68HC05PD6 12-12 rev 1.1 note pll1,0 = 11 is valid only in hc05pd6. writing 11 to pll should be avoided when using a hc705pd6 device. ds1, ds0 these two bits set the data speed of the incoming data. dpol this bit de?es the polarity of the incoming data. 0 = positive polarity 1 = negative polarity fa0, fa1, fa2 these specify the frame number that the 6 user de?ed addresses belong to. refer to table 12-2 for detailed description. 12.4.4 p-decoder status register (pdsr) pll1 pll0 pll time 0 0 0.42 ms 0 1 10.17 ms 1 0 33.81 ms 1 1 62.96 ms ds1 ds0 data speed 0 0 512 bps 0 1 1200 bps 1 0 2400 bps 1 1 512 bps w r pdsr $0010 reset t 0 0 7 00 54 0 0000 6 3210 0 dcf dbf msgf adrf errf scf option map
july 7, 1997 general release specification mc68HC05PD6 p-decoder motorola rev 1.1 12-13 errf ?error flag in most situation, when errf= 0, it indicates that there is 2 or less than 2 bits error in the received message codeword and correction has been done. but in some cases, errf= 0 even there is more than 2 bits error. when errf= 1, it indicates that there is more than 2 bits error in the received message codeword and the data in the received message information registers are invalid. the p-decoder will then stop receiving the codewords following this error codeword. scf ?synchronization code detection flag when the p-decoder cannot detect the synchronization code, scf is cleared. otherwise, scf is set. dcf ?data received complete flag this ?g is set when all the data is completely received. after serving this interrupt, it is the users responsibility to clear this bit, otherwise the cpu will keep on serving this interrupt. dbf ?data receiving begin flag this ?g is set when the p-decoder begins to receive data into the address and message registers. after serving this interrupt, it is the users responsibility to clear this bit, otherwise the cpu will keep on serving this interrupt. msgf ?message received flag this ?g is set when 20 bits of message has been stored in the received message information registers. after serving this interrupt, it is the users responsibility to clear this bit, otherwise the cpu will keep on serving this interrupt. adrf this ?g is set when 3 bits of address and 2 function bits have been stored in the received address information register. after serving this interrupt, it is the users responsibility to clear this bit, otherwise the cpu will keep on serving this interrupt. 12.4.5 user address registers there are six user addresses and two self-frames for receiving public services. each of these six addresses has 18 bits and 1 frame selection bit to select whether fa or fb in pdcr1 are used. the six user addresses are a0-a17, b0-b17, c0-c17, d0-d17, e0-e17 and f0-f17 respectively from $14-$25.
general release specification july 7, 1997 motorola p-decoder mc68HC05PD6 12-14 rev 1.1 a17-a0 is the 18-bit user de?ed address. afns 0 = the value in fa is assigned to address a. user address, a17-a0, is compared to the frame number speci?d in fa of the incoming data. 1 = the values in fb is assigned to address a. user address, a17-a0, is compared to the frame numbers speci?d in fb of the incoming data. note if less than 6 user addresses are used, say only 3 user addresses are used, the 3 unused addresses must be written with the same values as any of the addresses used. for example, if address a = 000008, b = 801aa3, d = 016913, then address c, e, f should be written to 000008, 016913 and 016913 respectively or both written to 000008 or etc... w r adra0 $0014 reset t a7 0 7 00 54 0 0000 6 3210 a6 a3 a2 a1 a0 a5 a4 option map w r adra1 $0015 reset t a15 0 7 00 54 0 0000 6 3210 a14 a11 a10 a9 a8 a13 a12 option map w r adra2 $0016 reset t afns 0 7 00 54 0 0000 6 3210 0 0 0 a17 a16 00 option map
july 7, 1997 general release specification mc68HC05PD6 p-decoder motorola rev 1.1 12-15 12.4.6 received address information register (rair) f1, f0 these two bits store the data of the function bits. ra2-ra0 these three bits show which one of the six user address matches the incoming address. 12.4.7 received message information registers (rmir x ) f1 f0 function 00 a 01 b 10 c 11 d w r rair $0026 reset t 0 0 7 00 54 0 0000 6 3210 0 0 ra2 ra1 ra0 f1 f0 option map w r rmir0 $0027 reset t rmi7 0 7 00 54 0 0000 6 3210 rmi6 rmi3 rmi2 rmi1 rmi0 rmi5 rmi4 option map w r rmir1 $0028 reset t rmi15 0 7 00 54 0 0000 6 3210 rmi14 rmi11 rmi10 rmi9 rmi8 rmi13 rmi12 option map
general release specification july 7, 1997 motorola p-decoder mc68HC05PD6 12-16 rev 1.1 these three registers store the 20 bits of message received. w r rmir2 $0029 reset t 0 0 7 00 54 0 0000 6 3210 0 rmi19 rmi18 rmi17 rmi16 0 0 option map
july 7, 1997 general release specification mc68HC05PD6 p-decoder motorola rev 1.1 12-17 figure 12-6. p-decoder flags timing 00 01 02 29 30 31 00 01 02 00 01 02 00 01 02 28 29 30 dbf adrf msgf errf dcf self-address codeword message codeword other address/ idle codeword note: dbf, adrf, msgf and dcf should be cleared by user 28 29 30 31 28 29 30 31 28 1 codeword
general release specification july 7, 1997 motorola p-decoder mc68HC05PD6 12-18 rev 1.1 figure 12-7. receiving mode timing d1 d1 0 d1 d1 1 d1 d1 7 d1 d1 3 d1 d1 5 d1 d1 2 d1 d1 4 d1 d1 6 sc d1 d1 0 ad mc 1 d1 d1 7 mc mc 3 mc mc 5 mc mc 2 mc mc 4 d2 d1 6 sc d1 d1 0 ad mc 1 d1 d1 7 d2 d1 3 d1 d1 5 mc mc 2 d1 d1 4 d1 d1 6 sc sc preamble bs1 bs2 bs3 dbf dcf scf conditions: 1. fns in user address registers = 0. 2. fa in pdcr2 register = 1. notes: 1. d1: other address/ message/ idle codeword 2. d2: other address/ idle codeword 3. ad: self-address codeword 4. mc: message codeword 5. sc: sc codeword
july 7, 1997 general release specification mc68HC05PD6 instruction set motorola rev 1.1 13-1 section 13 instruction set this section describes the addressing modes and instruction types. 13.1 addressing modes the cpu uses eight addressing modes for ?xibility in accessing data. the addressing modes de?e the manner in which the cpu ?ds the data required to execute an instruction. the eight addressing modes are the following: inherent immediate direct extended indexed, no offset indexed, 8-bit offset indexed, 16-bit offset relative 13.1.1 inherent inherent instructions are those that have no operand, such as return from interrupt (rti) and stop (stop). some of the inherent instructions act on data in the cpu registers, such as set carry ?g (sec) and increment accumulator (inca). inherent instructions require no memory address and are one byte long. 13.1.2 immediate immediate instructions are those that contain a value to be used in an operation with the value in the accumulator or index register. immediate instructions require no memory address and are two bytes long. the opcode is the ?st byte, and the immediate data value is the second byte.
general release specification july 7, 1997 motorola instruction set mc68HC05PD6 13-2 rev 1.1 13.1.3 direct direct instructions can access any of the ?st 256 memory addresses with two bytes. the ?st byte is the opcode, and the second is the low byte of the operand address. in direct addressing, the cpu automatically uses $00 as the high byte of the operand address. brset and brclr are three-byte instructions that use direct addressing to access the operand and relative addressing to specify a branch destination. 13.1.4 extended extended instructions use only three bytes to access any address in memory. the ?st byte is the opcode; the second and third bytes are the high and low bytes of the operand address. when using the motorola assembler, the programmer does not need to specify whether an instruction is direct or extended. the assembler automatically selects the shortest form of the instruction. 13.1.5 indexed, no offset indexed instructions with no offset are one-byte instructions that can access data with variable addresses within the ?st 256 memory locations. the index register contains the low byte of the conditional address of the operand. the cpu automatically uses $00 as the high byte, so these instructions can address locations $0000?00ff. indexed, no offset instructions are often used to move a pointer through a table or to hold the address of a frequently used ram or i/o location. 13.1.6 indexed, 8-bit offset indexed, 8-bit offset instructions are two-byte instructions that can access data with variable addresses within the ?st 511 memory locations. the cpu adds the unsigned byte in the index register to the unsigned byte following the opcode. the sum is the conditional address of the operand. these instructions can access locations $0000?01fe. indexed 8-bit offset instructions are useful for selecting the kth element in an n-element table. the table can begin anywhere within the ?st 256 memory locations and could extend as far as location 510 ($01fe). the k value is typically in the index register, and the address of the beginning of the table is in the byte following the opcode.
july 7, 1997 general release specification mc68HC05PD6 instruction set motorola rev 1.1 13-3 13.1.7 indexed, 16-bit offset indexed, 16-bit offset instructions are three-byte instructions that can access data with variable addresses at any location in memory. the cpu adds the unsigned byte in the index register to the two unsigned bytes following the opcode. the sum is the conditional address of the operand. the ?st byte after the opcode is the high byte of the 16-bit offset; the second byte is the low byte of the offset. these instructions can address any location in memory. indexed, 16-bit offset instructions are useful for selecting the kth element in an n-element table anywhere in memory. as with direct and extended addressing, the motorola assembler determines the shortest form of indexed addressing. 13.1.8 relative relative addressing is only for branch instructions. if the branch condition is true, the cpu ?ds the conditional branch destination by adding the signed byte following the opcode to the contents of the program counter. if the branch condition is not true, the cpu goes to the next instruction. the offset is a signed, twos complement byte that gives a branching range of ?28 to +127 bytes from the address of the next location after the branch instruction. when using the motorola assembler, the programmer does not need to calculate the offset, because the assembler determines the proper offset and veri?s that it is within the span of the branch. 13.1.9 instruction types the mcu instructions fall into the following ?e categories: register/memory instructions read-modify-write instructions jump/branch instructions bit manipulation instructions control instructions
general release specification july 7, 1997 motorola instruction set mc68HC05PD6 13-4 rev 1.1 13.1.10 register/memory instructions most of these instructions use two operands. one operand is in either the accumulator or the index register. the cpu ?ds the other operand in memory. table 13-1 lists the register/memory instructions. table 13-1. register/memory instructions instruction mnemonic add memory byte and carry bit to accumulator adc add memory byte to accumulator add and memory byte with accumulator and bit test accumulator bit compare accumulator cmp compare index register with memory byte cpx exclusive or accumulator with memory byte eor load accumulator with memory byte lda load index register with memory byte ldx multiply mul or accumulator with memory byte ora subtract memory byte and carry bit from accumulator sbc store accumulator in memory sta store index register in memory stx subtract memory byte from accumulator sub
july 7, 1997 general release specification mc68HC05PD6 instruction set motorola rev 1.1 13-5 13.1.11 read-modify-write instructions these instructions read a memory location or a register, modify its contents, and write the modi?d value back to the memory location or to the register. the test for negative or zero instruction (tst) is an exception to the read-modify-write sequence because it does not write a replacement value. table 13-2 lists the read-modify-write instructions. 13.1.12 jump/branch instructions jump instructions allow the cpu to interrupt the normal sequence of the program counter. the unconditional jump instruction (jmp) and the jump to subroutine instruction (jsr) have no register operand. branch instructions allow the cpu to interrupt the normal sequence of the program counter when a test condition is met. if the test condition is not met, the branch is not performed. all branch instructions use relative addressing. bit test and branch instructions cause a branch based on the state of any readable bit in the ?st 256 memory locations. these three-byte instructions use a combination of direct addressing and relative addressing. the direct address of the byte to be tested is in the byte following the opcode. the third byte is the signed offset byte. the cpu ?ds the conditional branch destination by adding the table 13-2. read-modify-write instructions instruction mnemonic arithmetic shift left asl arithmetic shift right asr clear bit in memory bclr set bit in memory bset clear clr complement (one? complement) com decrement dec increment inc logical shift left lsl logical shift right lsr negate (two? complement) neg rotate left through carry bit rol rotate right through carry bit ror test for negative or zero tst
general release specification july 7, 1997 motorola instruction set mc68HC05PD6 13-6 rev 1.1 third byte to the program counter if the speci?d bit tests true. the bit to be tested and its condition (set or clear) is part of the opcode. the span of branching is from ?28 to +127 from the address of the next location after the branch instruction. the cpu also transfers the tested bit to the carry/borrow bit of the condition code register. table 13-3 lists the jump and branch instructions. table 13-3. jump and branch instructions instruction mnemonic branch if carry bit clear bcc branch if carry bit set bcs branch if equal beq branch if half-carry bit clear bhcc branch if half-carry bit set bhcs branch if higher bhi branch if higher or same bhs branch if irq pin high bih branch if irq pin low bil branch if lower blo branch if lower or same bls branch if interrupt mask clear bmc branch if minus bmi branch if interrupt mask set bms branch if not equal bne branch if plus bpl branch always bra branch if bit clear brclr branch never brn branch if bit set brset branch to subroutine bsr unconditional jump jmp jump to subroutine jsr
july 7, 1997 general release specification mc68HC05PD6 instruction set motorola rev 1.1 13-7 13.1.13 bit manipulation instructions the cpu can set or clear any writable bit in the ?st 256 bytes of memory. port registers, port data direction registers, timer registers, and on-chip ram locations are in the ?st 256 bytes of memory. the cpu can also test and branch based on the state of any bit in any of the ?st 256 memory locations. bit manipulation instructions use direct addressing. table 13-4 lists these instructions. 13.1.14 control instructions these register reference instructions control cpu operation during program execution. control instructions, listed in table 13-5 , use inherent addressing. table 13-4. bit manipulation instructions instruction mnemonic clear bit bclr branch if bit clear brclr branch if bit set brset set bit bset table 13-5. control instructions instruction mnemonic clear carry bit clc clear interrupt mask cli no operation nop reset stack pointer rsp return from interrupt rti return from subroutine rts set carry bit sec set interrupt mask sei stop oscillator and enable irq pin stop software interrupt swi transfer accumulator to index register tax transfer index register to accumulator txa stop cpu clock and enable interrupts wait
general release specification july 7, 1997 motorola instruction set mc68HC05PD6 13-8 rev 1.1 13.1.15 instruction set summary table 13-6 is an alphabetical list of all m68hc05 instructions and shows the effect of each instruction on the condition code register. table 13-6. instruction set summary source form operation description effect on ccr address mode opcode operand cycles h i nzc adc # opr adc opr adc opr adc opr ,x adc opr ,x adc ,x add with carry a ? (a) + (m) + (c) imm dir ext ix2 ix1 ix a9 b9 c9 d9 e9 f9 ii dd hh ll ee ff ff 2 3 4 5 4 3 add # opr add opr add opr add opr ,x add opr ,x add ,x add without carry a ? (a) + (m) imm dir ext ix2 ix1 ix ab bb cb db eb fb ii dd hh ll ee ff ff 2 3 4 5 4 3 and # opr and opr an d opr and opr ,x and opr ,x and ,x logical and a ? (a) (m) imm dir ext ix2 ix1 ix a4 b4 c4 d4 e4 f4 ii dd hh ll ee ff ff 2 3 4 5 4 3 asl opr asla aslx asl opr ,x asl ,x arithmetic shift left (same as lsl) dir inh inh ix1 ix 38 48 58 68 78 dd ff 5 3 3 6 5 asr opr asra asrx asr opr ,x asr ,x arithmetic shift right dir inh inh ix1 ix 37 47 57 67 77 dd ff 5 3 3 6 5 bcc rel branch if carry bit clear pc ? (pc) + 2 + rel ? c = 0 rel 24 rr 3 bclr n opr clear bit n mn ? 0 dir (b0) dir (b1) dir (b2) dir (b3) dir (b4) dir (b5) dir (b6) dir (b7) 11 13 15 17 19 1b 1d 1f dd dd dd dd dd dd dd dd 5 5 5 5 5 5 5 5 bcs rel branch if carry bit set (same as blo) pc ? (pc) + 2 + rel ? c = 1 rel 25 rr 3 beq rel branch if equal pc ? (pc) + 2 + rel ? z = 1 rel 27 rr 3 c b0 b7 0 b0 b7 c
july 7, 1997 general release specification mc68HC05PD6 instruction set motorola rev 1.1 13-9 bhcc rel branch if half-carry bit clear pc ? (pc) + 2 + rel ? h = 0 rel 28 rr 3 bhcs rel branch if half-carry bit set pc ? (pc) + 2 + rel ? h = 1 rel 29 rr 3 bhi rel branch if higher pc ? (pc) + 2 + rel ? c z = 0 rel 22 rr 3 bhs rel branch if higher or same pc ? (pc) + 2 + rel ? c = 0 rel 24 rr 3 bih rel branch if irq pin high pc ? (pc) + 2 + rel ? irq = 1 rel 2f rr 3 bil rel branch if irq pin low pc ? (pc) + 2 + rel ? irq = 0 rel 2e rr 3 bit # opr bit opr bit opr bit opr ,x bit opr ,x bit ,x bit test accumulator with memory byte (a) (m) imm dir ext ix2 ix1 ix a5 b5 c5 d5 e5 f5 ii dd hh ll ee ff ff p 2 3 4 5 4 3 blo rel branch if lower (same as bcs) pc ? (pc) + 2 + rel ? c = 1 rel 25 rr 3 bls rel branch if lower or same pc ? (pc) + 2 + rel ? c z = 1 rel 23 rr 3 bmc rel branch if interrupt mask clear pc ? (pc) + 2 + rel ? i = 0 rel 2c rr 3 bmi rel branch if minus pc ? (pc) + 2 + rel ? n = 1 rel 2b rr 3 bms rel branch if interrupt mask set pc ? (pc) + 2 + rel ? i = 1 rel 2d rr 3 bne rel branch if not equal pc ? (pc) + 2 + rel ? z = 0 rel 26 rr 3 bpl rel branch if plus pc ? (pc) + 2 + rel ? n = 0 rel 2a rr 3 bra rel branch always pc ? (pc) + 2 + rel ? 1 = 1 rel 20 rr 3 brclr n opr rel branch if bit n clear pc ? (pc) + 2 + rel ? mn = 0 dir (b0) dir (b1) dir (b2) dir (b3) dir (b4) dir (b5) dir (b6) dir (b7) 01 03 05 07 09 0b 0d 0f dd rr dd rr dd rr dd rr dd rr dd rr dd rr dd rr 5 5 5 5 5 5 5 5 brset n opr rel branch if bit n set pc ? (pc) + 2 + rel ? mn = 1 dir (b0) dir (b1) dir (b2) dir (b3) dir (b4) dir (b5) dir (b6) dir (b7) 00 02 04 06 08 0a 0c 0e dd rr dd rr dd rr dd rr dd rr dd rr dd rr dd rr 5 5 5 5 5 5 5 5 brn rel branch never pc ? (pc) + 2 + rel ? 1 = 0 rel 21 rr 3 table 13-6. instruction set summary (continued) source form operation description effect on ccr address mode opcode operand cycles h i nzc
general release specification july 7, 1997 motorola instruction set mc68HC05PD6 13-10 rev 1.1 bset n opr set bit n mn ? 1 dir (b0) dir (b1) dir (b2) dir (b3) dir (b4) dir (b5) dir (b6) dir (b7) 10 12 14 16 18 1a 1c 1e dd dd dd dd dd dd dd dd 5 5 5 5 5 5 5 5 bsr rel branch to subroutine pc ? (pc) + 2; push (pcl) sp ? (sp) ?1; push (pch) sp ? (sp) ?1 pc ? (pc) + rel rel ad rr 6 clc clear carry bit c ? 0 0 inh 98 2 cli clear interrupt mask i ? 0 0 inh 9a 2 clr opr clra clrx clr opr ,x clr ,x clear byte m ? $00 a ? $00 x ? $00 m ? $00 m ? $00 0 1 dir inh inh ix1 ix 3f 4f 5f 6f 7f dd ff 5 3 3 6 5 cmp # opr cmp opr cmp opr cmp opr ,x cmp opr ,x cmp ,x compare accumulator with memory byte (a) ?(m) imm dir ext ix2 ix1 ix a1 b1 c1 d1 e1 f1 ii dd hh ll ee ff ff 2 3 4 5 4 3 com opr coma comx com opr ,x com ,x complement byte (one? complement) m ? ( ) = $ff ?(m) a ? ( ) = $ff ?(m) x ? ( ) = $ff ?(m) m ? ( ) = $ff ?(m) m ? ( ) = $ff ?(m) 1 dir inh inh ix1 ix 33 43 53 63 73 dd ff 5 3 3 6 5 cpx # opr cpx opr cpx opr cpx opr ,x cpx opr ,x cpx ,x compare index register with memory byte (x) ?(m) 1 imm dir ext ix2 ix1 ix a3 b3 c3 d3 e3 f3 ii dd hh ll ee ff ff 2 3 4 5 4 3 dec opr deca decx dec opr ,x dec ,x decrement byte m ? (m) ?1 a ? (a) ?1 x ? (x) ?1 m ? (m) ?1 m ? (m) ?1 dir inh inh ix1 ix 3a 4a 5a 6a 7a dd ff 5 3 3 6 5 eor # opr eor opr eor opr eor opr ,x eor opr ,x eor ,x exclusive or accumulator with memory byte a ? (a) ? (m) imm dir ext ix2 ix1 ix a8 b8 c8 d8 e8 f8 ii dd hh ll ee ff ff 2 3 4 5 4 3 table 13-6. instruction set summary (continued) source form operation description effect on ccr address mode opcode operand cycles h i nzc m a x m m
july 7, 1997 general release specification mc68HC05PD6 instruction set motorola rev 1.1 13-11 inc opr inca incx inc opr ,x inc ,x increment byte m ? (m) + 1 a ? (a) + 1 x ? (x) + 1 m ? (m) + 1 m ? (m) + 1 dir inh inh ix1 ix 3c 4c 5c 6c 7c dd ff 5 3 3 6 5 jmp opr jmp opr jmp opr ,x jmp opr ,x jmp ,x unconditional jump pc ? jump address dir ext ix2 ix1 ix bc cc dc ec fc dd hh ll ee ff ff 2 3 4 3 2 jsr opr jsr opr jsr opr ,x jsr opr ,x jsr ,x jump to subroutine pc ? (pc) + n (n = 1, 2, or 3) push (pcl); sp ? (sp) ?1 push (pch); sp ? (sp) ?1 pc ? conditional address dir ext ix2 ix1 ix bd cd dd ed fd dd hh ll ee ff ff 5 6 7 6 5 lda # opr lda opr lda opr lda opr ,x lda opr ,x lda ,x load accumulator with memory byte a ? (m) imm dir ext ix2 ix1 ix a6 b6 c6 d6 e6 f6 ii dd hh ll ee ff ff 2 3 4 5 4 3 ldx # opr ldx opr ldx opr ldx opr ,x ldx opr ,x ldx ,x load index register with memory byte x ? (m) imm dir ext ix2 ix1 ix ae be ce de ee fe ii dd hh ll ee ff ff 2 3 4 5 4 3 lsl opr lsla lslx lsl opr ,x lsl ,x logical shift left (same as asl) dir inh inh ix1 ix 38 48 58 68 78 dd ff 5 3 3 6 5 lsr opr lsra lsrx lsr opr ,x lsr ,x logical shift right 0 dir inh inh ix1 ix 34 44 54 64 74 dd ff 5 3 3 6 5 mul unsigned multiply x : a ? (x) (a) 0 0 inh 42 11 neg opr nega negx neg opr ,x neg ,x negate byte (two? complement) m ? ?m) = $00 ?(m) a ? ?a) = $00 ?(a) x ? ?x) = $00 ?(x) m ? ?m) = $00 ?(m) m ? ?m) = $00 ?(m) dir inh inh ix1 ix 30 40 50 60 70 ii ff 5 3 3 6 5 nop no operation inh 9d 2 table 13-6. instruction set summary (continued) source form operation description effect on ccr address mode opcode operand cycles h i nzc c b0 b7 0 b0 b7 c 0
general release specification july 7, 1997 motorola instruction set mc68HC05PD6 13-12 rev 1.1 ora # opr ora opr ora opr ora opr ,x ora opr ,x ora ,x logical or accumulator with memory a ? (a) (m) imm dir ext ix2 ix1 ix aa ba ca da ea fa ii dd hh ll ee ff ff 2 3 4 5 4 3 rol opr rola rolx rol opr ,x rol ,x rotate byte left through carry bit dir inh inh ix1 ix 39 49 59 69 79 dd ff 5 3 3 6 5 ror opr rora rorx ror opr ,x ror ,x rotate byte right through carry bit dir inh inh ix1 ix 36 46 56 66 76 dd ff 5 3 3 6 5 rsp reset stack pointer sp ? $00ff inh 9c 2 rti return from interrupt sp ? (sp) + 1; pull (ccr) sp ? (sp) + 1; pull (a) sp ? (sp) + 1; pull (x) sp ? (sp) + 1; pull (pch) sp ? (sp) + 1; pull (pcl) inh 80 6 rts return from subroutine sp ? (sp) + 1; pull (pch) sp ? (sp) + 1; pull (pcl) inh sbc # opr sbc opr sbc opr sbc opr ,x sbc opr ,x sbc ,x subtract memory byte and carry bit from accumulator a ? (a) ?(m) ?(c) imm dir ext ix2 ix1 ix a2 b2 c2 d2 e2 f2 ii dd hh ll ee ff ff 2 3 4 5 4 3 sec set carry bit c ? 1 1 inh 99 2 sei set interrupt mask i ? 1 1 inh 9b 2 sta opr sta opr sta opr ,x sta opr ,x sta ,x store accumulator in memory m ? (a) dir ext ix2 ix1 ix b7 c7 d7 e7 f7 dd hh ll ee ff ff 4 5 6 5 4 stop stop oscillator and enable irq pin 0 inh 8e 2 stx opr stx opr stx opr ,x stx opr ,x stx ,x store index register in memory m ? (x) dir ext ix2 ix1 ix bf cf df ef ff dd hh ll ee ff ff 4 5 6 5 4 table 13-6. instruction set summary (continued) source form operation description effect on ccr address mode opcode operand cycles h i nzc c b0 b7 b0 b7 c
july 7, 1997 general release specification mc68HC05PD6 instruction set motorola rev 1.1 13-13 sub # opr sub opr sub opr sub opr ,x sub opr ,x sub ,x subtract memory byte from accumulator a ? (a) ?(m) imm dir ext ix2 ix1 ix a0 b0 c0 d0 e0 f0 ii dd hh ll ee ff ff 2 3 4 5 4 3 swi software interrupt pc ? (pc) + 1; push (pcl) sp ? (sp) ?1; push (pch) sp ? (sp) ?1; push (x) sp ? (sp) ?1; push (a) sp ? (sp) ?1; push (ccr) sp ? (sp) ?1; i ? 1 pch ? interrupt vector high byte pcl ? interrupt vector low byte 1 inh 83 10 tax transfer accumulator to index register x ? (a) inh 97 2 tst opr tsta tstx tst opr ,x tst ,x test memory byte for negative or zero (m) ?$00 dir inh inh ix1 ix 3d 4d 5d 6d 7d dd ff 4 3 3 5 4 txa transfer index register to accumulator a ? (x) inh 9f 2 wait stop cpu clock and enable interrupts inh 8f 2 a accumulator opr operand (one or two bytes) c carry/borrow flag pc program counter ccr condition code register pch program counter high byte dd direct address of operand pcl program counter low byte dd rr direct address of operand and relative offset of branch instruction rel relative addressing mode dir direct addressing mode rel relative program counter offset byte ee ff high and low bytes of offset in indexed, 16-bit offset addressing rr relative program counter offset byte ext extended addressing mode sp stack pointer ff offset byte in indexed, 8-bit offset addressing x index register h half-carry flag z zero flag hh ll high and low bytes of operand address in extended addressing # immediate value i interrupt mask logical and ii immediate operand byte logical or imm immediate addressing mode ? logical exclusive or inh inherent addressing mode ( ) contents of ix indexed, no offset addressing mode ? ) negation (two? complement) ix1 indexed, 8-bit offset addressing mode ? loaded with ix2 indexed, 16-bit offset addressing mode ? if m memory location : concatenated with n negative flag set or cleared n any bit not affected table 13-6. instruction set summary (continued) source form operation description effect on ccr address mode opcode operand cycles h i nzc
motorola instruction set mc68HC05PD6 13-14 rev 1.1 table 13-7. opcode map bit manipulation branch read-modify-write control register/memory dir dir rel dir inh inh ix1 ix inh inh imm dir ext ix2 ix1 ix 0123456789abcdef 0 5 brset0 3 dir 5 bset0 2 dir 3 bra 2 rel 5 neg 2 dir 3 nega 1 inh 3 negx 1 inh 6 neg 2 ix1 5 neg 1ix 9 rti 1 inh 2 sub 2 imm 3 sub 2 dir 4 sub 3 ext 5 sub 3 ix2 4 sub 2 ix1 3 sub 1ix 0 1 5 brclr0 3 dir 5 bclr0 2 dir 3 brn 2 rel 6 rts 1 inh 2 cmp 2 imm 3 cmp 2 dir 4 cmp 3 ext 5 cmp 3 ix2 4 cmp 2 ix1 3 cmp 1ix 1 2 5 brset1 3 dir 5 bset1 2 dir 3 bhi 2 rel 11 mul 1 inh 2 sbc 2 imm 3 sbc 2 dir 4 sbc 3 ext 5 sbc 3 ix2 4 sbc 2 ix1 3 sbc 1ix 2 3 5 brclr1 3 dir 5 bclr1 2 dir 3 bls 2 rel 5 com 2 dir 3 coma 1 inh 3 comx 1 inh 6 com 2 ix1 5 com 1ix 10 swi 1 inh 2 cpx 2 imm 3 cpx 2 dir 4 cpx 3 ext 5 cpx 3 ix2 4 cpx 2 ix1 3 cpx 1ix 3 4 5 brset2 3 dir 5 bset2 2 dir 3 bcc 2 rel 5 lsr 2 dir 3 lsra 1 inh 3 lsrx 1 inh 6 lsr 2 ix1 5 lsr 1ix 2 and 2 imm 3 and 2 dir 4 and 3 ext 5 and 3 ix2 4 and 2 ix1 3 and 1ix 4 5 5 brclr2 3 dir 5 bclr2 2 dir 3 bcs/blo 2 rel 2 bit 2 imm 3 bit 2 dir 4 bit 3 ext 5 bit 3 ix2 4 bit 2 ix1 3 bit 1ix 5 6 5 brset3 3 dir 5 bset3 2 dir 3 bne 2 rel 5 ror 2 dir 3 rora 1 inh 3 rorx 1 inh 6 ror 2 ix1 5 ror 1ix 2 lda 2 imm 3 lda 2 dir 4 lda 3 ext 5 lda 3 ix2 4 lda 2 ix1 3 lda 1ix 6 7 5 brclr3 3 dir 5 bclr3 2 dir 3 beq 2 rel 5 asr 2 dir 3 asra 1 inh 3 asrx 1 inh 6 asr 2 ix1 5 asr 1ix 2 tax 1 inh 4 sta 2 dir 5 sta 3 ext 6 sta 3 ix2 5 sta 2 ix1 4 sta 1ix 7 8 5 brset4 3 dir 5 bset4 2 dir 3 bhcc 2 rel 5 asl/lsl 2 dir 3 asla/lsla 1 inh 3 aslx/lslx 1 inh 6 asl/lsl 2 ix1 5 asl/lsl 1ix 2 clc 1 inh 2 eor 2 imm 3 eor 2 dir 4 eor 3 ext 5 eor 3 ix2 4 eor 2 ix1 3 eor 1ix 8 9 5 brclr4 3 dir 5 bclr4 2 dir 3 bhcs 2 rel 5 rol 2 dir 3 rola 1 inh 3 rolx 1 inh 6 rol 2 ix1 5 rol 1ix 2 sec 1 inh 2 adc 2 imm 3 adc 2 dir 4 adc 3 ext 5 adc 3 ix2 4 adc 2 ix1 3 adc 1ix 9 a 5 brset5 3 dir 5 bset5 2 dir 3 bpl 2 rel 5 dec 2 dir 3 deca 1 inh 3 decx 1 inh 6 dec 2 ix1 5 dec 1ix 2 cli 1 inh 2 ora 2 imm 3 ora 2 dir 4 ora 3 ext 5 ora 3 ix2 4 ora 2 ix1 3 ora 1ix a b 5 brclr5 3 dir 5 bclr5 2 dir 3 bmi 2 rel 2 sei 1 inh 2 add 2 imm 3 add 2 dir 4 add 3 ext 5 add 3 ix2 4 add 2 ix1 3 add 1ix b c 5 brset6 3 dir 5 bset6 2 dir 3 bmc 2 rel 5 inc 2 dir 3 inca 1 inh 3 incx 1 inh 6 inc 2 ix1 5 inc 1ix 2 rsp 1 inh 2 jmp 2 dir 3 jmp 3 ext 4 jmp 3 ix2 3 jmp 2 ix1 2 jmp 1ix c d 5 brclr6 3 dir 5 bclr6 2 dir 3 bms 2 rel 4 tst 2 dir 3 tsta 1 inh 3 tstx 1 inh 5 tst 2 ix1 4 tst 1ix 2 nop 1 inh 6 bsr 2 rel 5 jsr 2 dir 6 jsr 3 ext 7 jsr 3 ix2 6 jsr 2 ix1 5 jsr 1ix d e 5 brset7 3 dir 5 bset7 2 dir 3 bil 2 rel 2 stop 1 inh 2 ldx 2 imm 3 ldx 2 dir 4 ldx 3 ext 5 ldx 3 ix2 4 ldx 2 ix1 3 ldx 1ix e f 5 brclr7 3 dir 5 bclr7 2 dir 3 bih 2 rel 5 clr 2 dir 3 clra 1 inh 3 clrx 1 inh 6 clr 2 ix1 5 clr 1ix 2 wait 1 inh 2 txa 1 inh 4 stx 2 dir 5 stx 3 ext 6 stx 3 ix2 5 stx 2 ix1 4 stx 1ix f inh = inherent rel = relative imm = immediate ix = indexed, no offset dir = direct ix1 = indexed, 8-bit offset ext = extended ix2 = indexed, 16-bit offset 0 msb of opcode in hexadecimal lsb of opcode in hexadecimal 0 5 brset0 3 dir number of cycles opcode mnemonic number of bytes/addressing mode lsb msb lsb m s b lsb msb
july 4, 1997 general release specification mc68HC05PD6 electrical specifications motorola rev 1.1 14-1 section 14 electrical specifications 14.1 maximum ratings this device contains circuitry to protect the inputs against damage due to high static voltages or electric ?lds; however, it is advised that normal precautions be taken to avoid application of any voltage higher than maximum-rated voltages to this high-impedance circuit. for proper operation, it is recommended that v in and v out be constrained to the range v ss (v in or v out ) v dd . reliability of operation is enhanced if unused inputs are connected to an appropriate logic voltage level (e.g., either v ss or v dd ). 14.2 thermal characteristics table 14-1. maximum ratings (voltages referenced to v ss ) rating symbol value unit supply voltage v dd ?.3 to +7.0 v lcd supply voltage vlcd3 ?.3 to +7.0 v input voltage v in v ss ?.3 to v dd +0.3 v irq 1 and irq2 pin v in v ss ?.3 to 2v dd +0.3 v current drain per pin excluding pb1, pb2, v dd and v ss i ?5 ma operating temperature range (standard) (extended) t a t l to t h 0 to +70 ?0 to +85 c storage temperature range t stg ?5 to +150 c table 14-2. thermal characteristics characteristic symbol value unit thermal resistance 80-pin tqfp 80-pin qfp q ja q ja 100 120 c/w c/w
general release specification july 4, 1997 motorola electrical specifications mc68HC05PD6 14-2 rev 1.1 14.3 dc electrical characteristics table 14-3. dc electrical characteristics (5v) (v dd = 5v 10%, v ss = 0 vdc, t a = 0 c to +70 c, unless otherwise noted) characteristic symbol min typ max unit output voltage i load = 10.0 m a v ol v oh v dd ?.1 0.1 v output high voltage (v dd =5v) (i load =?.4 ma) all i/o ports v oh v dd ?.8 v output low voltage (v dd =5v) (i load =0.8 ma) ports a, b, c v ol 0.4 v output low voltage (v dd =5v) (i load = 5.0 ma) ports d, e, f, g, h v ol 0.4 v input high voltage all i/o ports, r eset , osc1, xosc1 v ih 0.7 v dd ? dd v input low voltage all i/o ports, reset , osc1, xosc1 v il v ss 0.2 v dd v supply current (see notes) run (f op =2mhz) wait (f op =2mhz) stop xosc=76.8khz, v dd =5v, t a =+25 c i dd 5.5 1.8 250 ma ma m a i/o ports hi-z leakage current all i/o ports i z 10 m a input pulldown current ports a, b, c (with pulldown activated) i il 50 70 90 m a input current osc1, xosc1 i in 1 m a capacitance ports (as input or output) rese t , osc1, osc2, xosc1, xosc2 c out c in 12 8 pf pf crystal oscillator mode feedback resistor osc1 to osc2 xosc1 to xosc2 r of r xof 1.5 5.0 2.0 6.0 3.0 7.0 m w m w crystal oscillator mode damping resistor xosc1 to xosc2 r xod 1.5 3 3.5 m w reset pull-up resistor r rst 81525k w
july 4, 1997 general release specification mc68HC05PD6 electrical specifications motorola rev 1.1 14-3 notes: 1. all values shown reflect average measurements. 2. typical values at midpoint of voltage range, 25 c only. 3. run (operating) i dd , wait i dd : measured using external square wave clock source to osc1 (f osc = 4.2 mhz/2.1mhz), all inputs 0.2 vdc from rail; no dc loads, less than 50pf on all outputs, c l = 20 pf on osc2. 4. wait i dd : all ports configured as inputs, v il = 0.2 vdc, v ih = v dd ?.2 vdc. 5. stop i dd measured with osc1 = v ss . 6. wait i dd is affected linearly by the osc2 capacitance. table 14-4. dc electrical characteristics (3.6v) (v dd = 3.6v 10%, v ss = 0 vdc, t a = 0 c to +70 c, unless otherwise noted) characteristic symbol min typ max unit output voltage i load = 10.0 m a v ol v oh v dd ?.1 0.1 v output high voltage (v dd =5v) (i load =?.4 ma) all i/o ports v oh v dd ?.8 v output low voltage (v dd =5v) (i load =0.8 ma) ports a, b, c v ol 0.4 v output low voltage (v dd =5v) (i load = 5.0 ma) ports d, e, f, g, h v ol 0.4 v input high voltage all i/o ports, r eset , osc1, xosc1 v ih 0.7 v dd ? dd v input low voltage all i/o ports, reset , osc1, xosc1 v il v ss 0.2 v dd v supply current (see notes) run (f op =1mhz) wait (f op =1mhz) stop xosc=76.8khz, v dd =5v, t a =+25 c i dd 2.5 600 250 ma m a m a i/o ports hi-z leakage current all i/o ports i z 10 m a input pulldown current ports a, b, c (with pulldown activated) i il 50 70 90 m a input current osc1, xosc1 i in 1 m a capacitance ports (as input or output) rese t , osc1, osc2, xosc1, xosc2 c out c in 12 8 pf pf crystal oscillator mode feedback resistor osc1 to osc2 xosc1 to xosc2 r of r xof 1.5 5.0 2.0 6.0 3.0 7.0 m w m w crystal oscillator mode damping resistor xosc1 to xosc2 r xod 1.5 3 3.5 m w reset pull-up resistor r rst 81525k w
general release specification july 4, 1997 motorola electrical specifications mc68HC05PD6 14-4 rev 1.1 14.4 control timing table 14-5. control timing (5v) (v dd = 5v 10%, v ss = 0 vdc, t a = 0 c to +70 c, unless otherwise noted) characteristic symbol min max units frequency of operation crystal oscillator option external clock source f osc f osc dc 4.2 4.2 mhz mhz internal operating frequency crystal oscillator (f osc ? 2) external clock (f osc ? 2) f op f op dc 2.1 2.1 mhz mhz cycle time (1/f op )t cyc 480 ns crystal oscillator start-up time (crystal oscillator option) t oxon 100 ms osc stop recovery time (crystal oscillator option) t oxsr 100 ms reset pulse width low t rl 1.5 t cyc irq interrupt pulse width low (edge-triggered) t ilih 125 ns irq interrupt pulse period t ilil note 1 t cyc osc1 pulse width t oh , t ol 100 ns
july 4, 1997 general release specification mc68HC05PD6 electrical specifications motorola rev 1.1 14-5 notes: 1. the minimum period t ilil or t ihih should not be less than the number of cycles it takes to execute the interrupt service routine plus 19 t cyc . table 14-6. control timing (3.6v) (v dd = 3.6v 10%, v ss = 0 vdc, t a = 0 c to +70 c, unless otherwise noted) characteristic symbol min max units frequency of operation crystal oscillator option external clock source f osc f osc dc 2.0 2.0 mhz mhz internal operating frequency crystal oscillator (f osc ? 2) external clock (f osc ? 2) f op f op dc 1.0 1.0 mhz mhz cycle time (1/f op )t cyc 960 ns crystal oscillator start-up time (crystal oscillator option) t oxon 200 ms osc stop recovery time (crystal oscillator option) t oxsr 200 ms reset pulse width low t rl 1.5 t cyc irq interrupt pulse width low (edge-triggered) t ilih 250 ns irq interrupt pulse period t ilil note 1 t cyc osc1 pulse width t oh , t ol 200 ns
general release specification july 4, 1997 motorola electrical specifications mc68HC05PD6 14-6 rev 1.1
july 7, 1997 general release specification mc68HC05PD6 mechanical specifications motorola rev 1.1 15-1 section 15 mechanical specifications this section provides the mechanical dimensions for the 80-pin tqfp and 80-pin qfp.
general release specification july 7, 1997 motorola mechanical specifications mc68HC05PD6 15-2 rev 1.1 15.1 80-pin thin-quad-flat-package (case 917-01) figure 15-1. 80-pin tqfp mechanical dimensions 4x b s a view y 61 60 40 41 21 80 20 1 e c view p p aa aa b1 j d f ???? ? ?? ? ???? r r1 a1 c1 k  2 view p s/2 a/2 b/2 v/2 v m l n 4x lm 0.20 (0.008) h n pin 1 ident 0.10 (0.004) 8x h datum plane notes: 1. dimensioning and tolerancing per ansi y14.5m, 1982. 2. controlling dimension: millimeter. 3. datum plane h is coincident with the bottom the lead where the lead exits the plastic body at the bottom of the parting line. 4. datums l, m and n to be determined at datum plane h. 5. dimensions s and v to be determined at seating plane t. 6. dimensions a and b do not include mold protrusion. allowable protrusion is 0.250 (0.010) per side. dimensions a and b do include mold mismatch and are determined at datum plane h. 7. dimensions d does not include dambar protrusion. the dambar protrusion shall not cause the d dimension to exceed 0.350 (0.014). dim min max min max inches millimeters a 12.000 bsc 0.472 bsc b 12.000 bsc 0.472 bsc c 1.600 0.063 d 0.170 0.270 0.0067 0.011 e 1.350 1.450 0.053 0.057 f 0.170 0.230 0.0067 0.009 g 0.500 bsc 0.0197 bsc j 0.122 0.208 0.0048 0.0082 k 0.350 0.650 0.014 0.026 m 10 14 10 14 p 0.250 bsc 0.0098 bsc s 14.000 bsc 0.551 bsc v 14.000 bsc 0.551 bsc w 0.040 0.160 0.002 0.006 a1 0.170 ref 0.007 ref b1 0.122 0.160 0.0048 0.0063 c1 1.000 ref 0.039 ref r1 0.200 ref 0.008 ref r2 0.200 ref 0.008 ref 0 8 0 8 0 6 0 6 w m lm 0.20 (0.008) h n 76x g t seating plane view y l, m, n 3 places section aaaa 80 places h datum plane r r2  1  1  2 rotated 90 clockwise plating base metal    
july 7, 1997 general release specification mc68HC05PD6 mechanical specifications motorola rev 1.1 15-3 15.2 80-pin quad-flat-package (case 841b-01) figure 15-2. 80-pin qfp mechanical dimensions               
          
 
     * 
 ( 
 ( 
  
 (   
     
   
 
    ( 
  * *           *(   (   (      (         
  
    (    *( *(    "!  !  "   ! '      "  ! " 
 "#  )) ! " " ""    ! " %" "  %  "  &"! " !" ' " " ""  "  "   "#! )) ))  )) "  "  " "#  ))  !! !  $ "  "  " !"  ))  !!     " #   " #! %  " #! !    ! !!     #  !"    "  " "#  ))  !  ! " #   " #! %   " #! !   
 ""  &!!  "  ! " &# "  "  "  "  " % #!  " " p -a,b,d- b b detail a f d n section b-b j -h-    detail c k q r t w x u    -h-    60 61 80 120 21 40 41 detail c     -c- m c h m g -b- -a- -d- b a l s v l e detail a       ! !            ! !        ! !            ! !  !  !  
!   ! 
! 
!          !!
general release specification july 7, 1997 motorola mechanical specifications mc68HC05PD6 15-4 rev 1.1
july 7, 1997 general release specification mc68HC05PD6 motorola rev 1.1 a-1 appendix a mc68hc705pd6 this appendix describes the differences between the mc68hc705pd6 and mc68HC05PD6. a.1 introduction the mc68hc705pd6 is an eprom version of the mc68HC05PD6, and is available for user system evaluation and debugging. the mc68hc705pd6 is functionally identical to the mc68HC05PD6 with the exception of the 16400 bytes user rom is replaced by 16400 bytes user eprom. also, the mask options available on the mc68HC05PD6 are implemented using the mask option register (mosr) in the mc68hc705pd6. the mc68hc705pd6 is available in 80-pin quad-flat-package (qfp). a.2 memory the mc68hc705pd6 memory map is shown in figure a-1 . a.3 mask option register (mosr), $000f the mask option register (mosr) is a byte of eprom used to select the features controlled by mask options on the mc68HC05PD6. rstr ?reset pin pull-up resistor 1 = internal pull-up resistor connected. 0 = internal pull-up resistor not connected. u 7 w r uu00000 654 3210 mosr $000f erased t 00 0 0 0 unaffected by reset reset t rstr oscr xoscr
general release specification july 7, 1997 motorola mc68HC05PD6 a-2 rev 1.1 oscr ?osc feedback resistor 1 = internal feedback resistor connected between osc1 and osc2. 0 = internal feedback resistor not connected. xoscr ?xosc feedback resistor 1 = internal feedback resistor connected between xosc1 and xosc2. 0 = internal feedback resistor not connected. figure a-1. mc68hc705pd6 memory map a.4 bootloader mode bootloader mode is entered upon the rising edge of reset if the v pp pin is at v tst , pc6 at logic one, and pc7 at logic zero. the bootloader program is masked in the rom area from $fe00 to $ffdf. this program handles copying of user code from an external eprom into the on-chip eprom. the bootload function has to be done from an external eprom. the bootloader performs one programming pass at 1ms per byte then does a verify pass. $0000 $003f 0000 0063 i/o registers i/o 64 bytes $0000 $003f $0040 $00c0 $00ff $023f $0240 $0fff $1000 $4fff $5000 $fdff $fe00 $ffdf $ffe0 $ffef $fff0 $ffff ram stack 64 bytes 512 bytes unused user eprom unused bootstrap rom bootstrap vectors user vectors dual mapped 64 bytes 0 63 64 191 192 255 256 575 576 4095 4096 20479 20480 65023 65024 65503 65504 65519 65520 65535 16k bytes
july 7, 1997 general release specification mc68HC05PD6 motorola rev 1.1 a-3 the user code must be a one-to-one correspondence with the internal eprom addresses. a.5 eprom programming programming the on-chip eprom is achieved by using the program control register located at address $3d. please contact motorola for programming board availability. a.5.1 eprom program control register (pcr) this register is provided for programming the on-chip eprom in the mc68hc705pd6. elat ?eprom latch control 0 = eprom address and data bus con?ured for normal reads 1 = eprom address and data bus con?ured for programming (writes to eprom cause address and data to be latched). eprom is in programming mode and cannot be read if elat is 1. this bit should not be set when no programming voltage is applied to the v pp pin. pgm ?eprom program command 0 = programming power is switched off from eprom array. 1 = programming power is switched on to eprom array. if elat 1 1, then pgm = 0. table a-1. operating mode initialization mode reset pc7/irq1 pc6/irq2 vpp single-chip (normal) v ss to v dd v ss to v dd v ss to v dd bootstrap v ss v dd v tst v tst =2 x v dd pcr $003d bit-7 bit-6 bit-5 bit4 bit-3 bit-2 bit1 bit-0 read reserved elat pgm write reset 0000 0 000
general release specification july 7, 1997 motorola mc68HC05PD6 a-4 rev 1.1 a.5.2 programming sequence the eprom programming sequence is: 1. set the elat bit 2. write the data to the address to be programmed 3. set the pgm bit 4. delay for a time t pgmr 5. clear the pgm bit 6. clear the elat bit the last two steps must be performed with separate cpu writes. caution it is important to remember that an external programming voltage must be applied to the v pp pin while programming, but it should be equal to v dd during normal operations. figure a-2 shows the ?w required to successfully program the eprom. a.6 eprom programming specifications table a-2. eprom programming electrical characteristics (v dd = 5v 10%, v ss = 0 vdc, t a = 0 c to +70 c, unless otherwise noted) characteristic symbol min typ max unit programming voltage irq /v pp v pp 12.5 14.5 v programming current irq /v pp i pp ma programming time per byte t epgm ?ms
july 7, 1997 general release specification mc68HC05PD6 motorola rev 1.1 a-5 start elat=1 write eprom byte epgm=1 wait 1ms epgm=0 elat=0 write additional byte? n y end figure a-2. eprom programming sequence
general release specification july 7, 1997 motorola mc68HC05PD6 a-6 rev 1.1
motorola reserves the right to make changes without further notice to any products herein. motorola makes no warranty, represe ntation or guarantee regarding the suitability of its products for any particular purpose, nor does motorola assume any liability arising out of the application o r use of any product or circuit, and speci?ally disclaims any and all liability, including without limitation consequential or incidental damages. "typical" parameters which may be provided in motorola data sheets and/or speci?ations can and do vary in different applications and actual performance may vary over time. all operating parameters, i ncluding "typicals" must be validated for each customer application by customer's technical experts. motorola does not convey any license under its patent rights nor the rig hts of others. motorola products are not designed, intended, or authorized for use as components in systems intended for surgical implant into the body, or other applic ations intended to support or sustain life, or for any other application in which the failure of the motorola product could create a situation where personal injury or death may occur. should buyer purchase or use motorola products for any such unintended or unauthorized application, buyer shall indemnify and hold motorola and its of?ers, employees, subsidiaries, af?iates, and distributors harmless against all claims, costs, damages, and expenses, and reasonable attorney fees arising out of, directly o r indirectly, any claim of personal injury or death associated with such unintended or unauthorized use, even if such claim alleges that motorola was negligent regarding the design or manufacture of the part. motorola and are registered trademarks of motorola, inc. motorola, inc. is an equal opportunity/af?mative action employer. how to reach us: mfax: rmfax0@email.sps.mot.com ?touchtone 602-244-6609 internet: http://www.mot-sps.com/csic usa/europe/locations not listed: motorola literature distribution; p.o. box 5405, denver, colorado 80217. 303-675-2140 or 1-800-441-2447 japan: nippon motorola ltd.; tatsumi-spd-jldc, 6f seibu-butsuryu-center, 3-14-2 tatsumi koto-ku, tokyo 135, japan. 03-81-3521-8315 asia/pacific: motorola semiconductors h.k. ltd.; 8b tai ping industrial park, 51 ting kok road, tai po, n.t., hong kong. 852-26629298 hc05pd6grs/h


▲Up To Search▲   

 
Price & Availability of 68HC05PD6

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X